Instructions to use tencent/WeVisOne-VL-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/WeVisOne-VL-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="tencent/WeVisOne-VL-2B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("tencent/WeVisOne-VL-2B") model = AutoModelForMultimodalLM.from_pretrained("tencent/WeVisOne-VL-2B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tencent/WeVisOne-VL-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tencent/WeVisOne-VL-2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tencent/WeVisOne-VL-2B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/tencent/WeVisOne-VL-2B
- SGLang
How to use tencent/WeVisOne-VL-2B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "tencent/WeVisOne-VL-2B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tencent/WeVisOne-VL-2B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "tencent/WeVisOne-VL-2B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tencent/WeVisOne-VL-2B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use tencent/WeVisOne-VL-2B with Docker Model Runner:
docker model run hf.co/tencent/WeVisOne-VL-2B
WeVisOne-VL: Unified Visual Perception from Objects to Pixels
WeVisOne-VL (WeChat Vision All-in-One) is a unified vision-language model developed by WeChat Vision, Tencent Inc. Built upon Qwen3-VL, it unifies object-level perception (open-vocabulary object detection, referring localization, object counting, object pointing, and OCR) and pixel-level perception (referring segmentation and promptable alpha matting) through structured next-token prediction and a lightweight 9.5M-parameter pixel decoder.
Quick Start
Install the inference package from GitHub, then:
from PIL import Image
from wevisone_vl import WeVisOneVL
model = WeVisOneVL("tencent/WeVisOne-VL-2B", device="auto", dtype="bfloat16")
image = Image.open("example.jpg").convert("RGB")
result = model.predict(image, task="matting", query="person", temperature=0.0)
print(result.response, len(result.masks))
Architecture & Released Revision
The model uses dedicated coordinate tokens (<0> ... <1000>) to represent normalized bounding boxes and points, returns None when a queried target is absent, and emits a special instance token (<OBJ>, token ID 152678) after each predicted box for dense tasks.
The attached mask_decoder.pt (9,511,460 parameters) is a required core component that combines:
- A Visual Feature Adapter over multi-level Qwen3-VL pre-merging ViT features;
- A Box-Guided Query Decoder with 6 deformable cross-attention blocks initialized from the
<OBJ>hidden state and Fourier-encoded box prior; - An Instance-Conditioned Dense Prediction Head with
FullCanvasAlphaCascadeHead(refining predictions across S/4, S/2, and S/1 to output full-resolution continuous alpha mattes at stride 1).
Intended Use
The release is intended for research in visual grounding, referring localization, pointing, counting, OCR localization, referring segmentation, and image matting. It is not intended to make autonomous high-impact decisions or to identify individuals.
Limitations
- Fine alpha boundaries remain sensitive to image resolution, severe occlusion, complex transparency, and prompt phrasing.
- For inference efficiency, the model directly generates structured outputs without explicit chain-of-thought (CoT) reasoning, and currently targets single-turn image perception (video grids are rejected by the pixel decoder).
License
Unless otherwise noted, Tencent-authored code in this repository is released under the Apache License 2.0.
Third-party components retain their original licenses and copyright notices. Please review the corresponding source files before use.
- Downloads last month
- -