egeorcun/lucida
Lucida — general-purpose background removal with soft-alpha mastery Lucida is a BiRefNet-based background-removal / image-matting model fine-tuned to excel where most open models fail: camouflaged objects, transparent materials (glass), text & logos...
Featured achievements
The project's latest awards
#1 Repository of the week
#1 Repository of the week
#1 Repository of the week
Lucida — general-purpose background removal with soft-alpha mastery
Lucida is a BiRefNet-based background-removal / image-matting model fine-tuned to excel where most open models fail: camouflaged objects, transparent materials (glass), text & logos, VFX glows, and illustrations — while staying competitive everywhere else.
On our 191-image, 8-category benchmark (MAE, lower is better) Lucida leads every model we tested — including a commercial reference — in camouflage (0.0273) and illustration (0.0095), matches the commercial reference in text/logo preservation (0.0126), and sets our best-ever transparency (0.0376) and overall (0.0304) scores. Full benchmark, gallery and training recipe: https://github.com/egeorcun/lucida — or try the live demo.
Usage
import torch
from PIL import Image
from torchvision import transforms
from transformers import AutoModelForImageSegmentation
model = AutoModelForImageSegmentation.from_pretrained(
"egeorcun/lucida", trust_remote_code=True, dtype=torch.float32)
model.eval()
t = transforms.Compose([
transforms.Resize((1024, 1024)),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]),
])
img = Image.open("input.jpg").convert("RGB")
with torch.no_grad():
preds = model(t(img).unsqueeze(0))[-1].sigmoid()
alpha = transforms.functional.resize(preds[0], img.size[::-1]).squeeze(0)
rgba = img.copy()
rgba.putalpha(Image.fromarray((alpha.numpy() * 255).astype("uint8")))
rgba.save("output.png")
For color decontamination (removing background color fringing) and the full pipeline (CLI, FastAPI service, Docker web UI), see the GitHub repository.
Base model & attribution
- Architecture and initial weights: ZhengPeng7/BiRefNet_HR (MIT). Lucida is a fine-tune; the original copyright notice is preserved.
- Illustration data includes ToonOut (CC-BY 4.0).
- Some training datasets (e.g. P3M-10k, COD10K, DIS5K) are distributed for research purposes; see the GitHub README for the full dataset/license table and evaluate suitability for your use case.
License
MIT (weights and code).
Similar Projects
Discover other similar projects and AI models.
BRIA Background Removal v1.4 Model Card RMBG v1.4 is our state-of-the-art background removal model, designed to effectively separate foreground from background in a range of categories and image types. This model has been trained on a carefully sele...
BRIA Background Removal v2.0 Model Card ✨ Discover FIBO on Hugging Face 💜 Bria AI   |   🤗 Hugging Face    |    📑 Blog    🖥️ Demo  |    Github   RMBG v2.0 is our new state-of-the-art...
Bilateral Reference for High-Resolution Dichotomous Image Segmentation Peng Zheng 1,4,5,6,  Dehong Gao 2,  Deng-Ping Fan 1,  Li Liu 3,  Jorma Laaksonen 4,  Wanli Ouyang 5,  Nicu Sebe 6 1 Nankai University&ens...
BRIA Background Removal v3.0 Model Card 🏆 1 in background removal in our head-to-head benchmark against Photoroom, remove.bg (Canva), Ideogram, BiRefNet and RMBG-2.0, on 234 hard images at full resolution. Background removal, reimagined as image ed...
all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...
Unlimited OCR Works Welcome the Era of One-shot Long-horizon Parsing. Release - 2026/06/23 📄 Our paper is now available on arXiv(https://arxiv.org/abs/2606.23050). - 2026/06/23 🤝 Thanks to the ModelScope community for their support. Our model is n...
BEN2: Background Erase Network !arXiv(https://img.shields.io/badge/arXiv-2501.06230-b31b1b.svg)(https://arxiv.org/abs/2501.06230) !GitHub(https://img.shields.io/badge/GitHub-BEN2-black.svg)(https://github.com/PramaLLC/BEN2/) !Website(https://img.shi...
DeepSeek-R1 Paper Link👁️ 1. Introduction We introduce our first-generation reasoning models, DeepSeek-R1-Zero and DeepSeek-R1. DeepSeek-R1-Zero, a model trained via large-scale reinforcement learning (RL) without supervised fine-tuning (SFT) as a p...
Background removal that keeps what matters: glass, camouflage, text, glow and line art. BiRefNet fine-tune, MIT.