If you just want to use this code, please refer to this sample below
from transformers import AutoModel, AutoTokenizer
from PIL import Image
model_path = "DeepGlint-AI/MLCD-Seg"# or use your local path
mlcd_seg = AutoModel.from_pretrained(
model_path,
torch_dtype=torch.float16,
trust_remote_code=True
).cuda()
tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False)
# Assuming you have an image named test.jpg
seg_img = Image.open("test.jpg").convert('RGB')
seg_prompt = "Could you provide a segmentation mask for the right giraffe in this image?"
pred_mask = model.seg(seg_img, seg_prompt, tokenizer, force_seg=False)
If you want to use this code measurement dataset (e.g. refcoco), then you need to use the following method
from transformers import AutoModel, AutoTokenizer
from PIL import Image
model_path = "DeepGlint-AI/MLCD-Seg"# or use your local path
mlcd_seg = AutoModel.from_pretrained(
model_path,
torch_dtype=torch.float16,
trust_remote_code=True
).cuda()
tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False)
# Assuming you have an image named test.jpg
seg_img = Image.open("test.jpg").convert('RGB')
seg_prompt = "Could you provide a segmentation mask for the right giraffe in this image?"
pred_mask = model.seg(seg_img, seg_prompt, tokenizer, force_seg=True)
Citations
@misc{mlcdseg_wukun,
author = {Wu, Kun and Xie, Yin and Zhou, Xinyu and An, Xiang, and Deng, Jiankang, and Jie, Yu},
title = {MLCD-Seg},
year = {2025},
url = {https://github.com/deepglint/unicom/tree/main/downstream},
}
Runs of DeepGlint-AI MLCD-Seg on huggingface.co
13
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
5
30-day runs
More Information About MLCD-Seg huggingface.co Model
MLCD-Seg huggingface.co is an AI model on huggingface.co that provides MLCD-Seg's model effect (), which can be used instantly with this DeepGlint-AI MLCD-Seg model. huggingface.co supports a free trial of the MLCD-Seg model, and also provides paid use of the MLCD-Seg. Support call MLCD-Seg model through api, including Node.js, Python, http.
MLCD-Seg huggingface.co is an online trial and call api platform, which integrates MLCD-Seg's modeling effects, including api services, and provides a free online trial of MLCD-Seg, you can try MLCD-Seg online for free by clicking the link below.
DeepGlint-AI MLCD-Seg online free url in huggingface.co:
MLCD-Seg is an open source model from GitHub that offers a free installation service, and any user can find MLCD-Seg on GitHub to install. At the same time, huggingface.co provides the effect of MLCD-Seg install, users can directly use MLCD-Seg installed effect in huggingface.co for debugging and trial. It also supports api for free installation.