VARCO-VISION-14B
is a powerful English-Korean Vision-Language Model (VLM) developed through four distinct training phases, culminating in a final preference optimization stage. Designed to excel in both multimodal and text-only tasks, VARCO-VISION-14B not only surpasses other models of similar size in performance but also achieves scores comparable to those of proprietary models. The model currently accepts a single image and accompanying text as input, generating text as output. It supports grounding—the ability to identify the locations of objects within an image—as well as OCR (Optical Character Recognition) to recognize text within images.
Developed by:
NC Research, Multimodal Generation Team
To use this model, ensure you have
transformers >= 4.45.0
installed.
import requests
from PIL import Image
from transformers import LlavaOnevisionForConditionalGeneration, AutoProcessor
model_name = "NCSOFT/VARCO-VISION-14B-HF"
model = LlavaOnevisionForConditionalGeneration.from_pretrained(
model_name,
torch_dtype="float16",
device_map="auto",
attn_implementation="flash_attention_2"
)
processor = AutoProcessor.from_pretrained(model_name)
device = model.device
# Define a chat history and use `apply_chat_template` to get correctly formatted prompt# Each value in "content" has to be a list of dicts with types ("text", "image")
conversation = [
{
"role": "user",
"content": [
{"type": "text", "text": "Describe this image."},
{"type": "image"},
],
},
]
prompt = processor.apply_chat_template(conversation, add_generation_prompt=True)
EOS_TOKEN = "<|im_end|>"
image_file = "http://images.cocodataset.org/val2017/000000039769.jpg"
raw_image = Image.open(requests.get(image_file, stream=True).raw)
inputs = processor(images=raw_image, text=prompt, return_tensors='pt').to(device)
output = model.generate(**inputs, max_new_tokens=1024, do_sample=False)
output = processor.decode(output[0][inputs.input_ids.shape[1]:])
if output.endswith(EOS_TOKEN):
output = output[: -len(EOS_TOKEN)]
output = output.strip()
print(output)
Specialized Features
To receive questions or answers based on bounding boxes (e.g., grounding, referring, OCR tasks), include special tokens in the input text.
The following special tokens are used to define specific tasks, inputs and outputs for the model:
<gro>
: Indicates that the model's response should include bounding box information.
<ocr>
: Specifies OCR tasks for recognizing text within an image.
<char>
and
</char>
: Used to mark a text phrase.
<obj>
and
</obj>
: Used to indicate an object.
<bbox>
and
</bbox>
: Used to represent a bounding box.
<delim>
: Represents multiple location points for a single object or text.
Grounding
Grounding refers to the task where the model identifies specific locations within an image to provide an answer. To perform grounding, prepend the special token
<gro>
to the question.
The image shows <obj>two cats</obj><bbox>0.014, 0.106, 0.51, 0.996<delim>0.51, 0.054, 0.996, 0.787</bbox> lying on <obj>a pink blanket</obj><bbox>0.003, 0.231, 0.999, 0.999</bbox>. The cat on the left is lying on its side with its head resting on the blanket, while the cat on the right is lying on its stomach with its head also resting on the blanket. Both cats appear to be relaxed and comfortable. There are <obj>two remote controls</obj><bbox>0.037, 0.141, 0.283, 0.253<delim>0.506, 0.171, 0.581, 0.295</bbox> placed near the cats, one on the left side and one on the right side of the image.
Referring
VARCO-VISION-14B can handle location-specific questions using bounding boxes. To perform referring tasks, structure the conversation by including the object of interest within
<obj>
and
</obj>
tags and specifying its location with
<bbox>
and
</bbox>
tags. This allows the model to understand the context and focus on the object at the specified location.
**이 물건**은 리모컨으로, 주로 텔레비전이나 다른 전자 기기를 원격으로 조작하는 데 사용됩니다. 리모컨에는 다양한 버튼이 있으며, 각 버튼은 채널 변경, 볼륨 조절, 전원 켜기/끄기 등의 기능을 수행합니다. 사용자는 리모컨을 손에 들고 버튼을 누르면, 해당 기기에 신호를 보내 원하는 조작을 할 수 있습니다. 리모컨은 일반적으로 가정이나 사무실에서 편리하게 전자 기기를 조작할 수 있도록 사용됩니다.
OCR
To perform Optical Character Recognition (OCR), use the
<ocr>
token.
VARCO-VISION-14B-HF huggingface.co is an AI model on huggingface.co that provides VARCO-VISION-14B-HF's model effect (), which can be used instantly with this NCSOFT VARCO-VISION-14B-HF model. huggingface.co supports a free trial of the VARCO-VISION-14B-HF model, and also provides paid use of the VARCO-VISION-14B-HF. Support call VARCO-VISION-14B-HF model through api, including Node.js, Python, http.
VARCO-VISION-14B-HF huggingface.co is an online trial and call api platform, which integrates VARCO-VISION-14B-HF's modeling effects, including api services, and provides a free online trial of VARCO-VISION-14B-HF, you can try VARCO-VISION-14B-HF online for free by clicking the link below.
NCSOFT VARCO-VISION-14B-HF online free url in huggingface.co:
VARCO-VISION-14B-HF is an open source model from GitHub that offers a free installation service, and any user can find VARCO-VISION-14B-HF on GitHub to install. At the same time, huggingface.co provides the effect of VARCO-VISION-14B-HF install, users can directly use VARCO-VISION-14B-HF installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
VARCO-VISION-14B-HF install url in huggingface.co: