Image-Text-to-Text
Transformers
Safetensors
qwen3_vl_moe
robotics
embodied-ai
video-understanding
progress-estimation
reward-modeling
qwen3-vl
conversational
Instructions to use InternRobotics/VLAC-Cut with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use InternRobotics/VLAC-Cut with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="InternRobotics/VLAC-Cut") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("InternRobotics/VLAC-Cut") model = AutoModelForMultimodalLM.from_pretrained("InternRobotics/VLAC-Cut", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use InternRobotics/VLAC-Cut with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "InternRobotics/VLAC-Cut" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "InternRobotics/VLAC-Cut", "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/InternRobotics/VLAC-Cut
- SGLang
How to use InternRobotics/VLAC-Cut 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 "InternRobotics/VLAC-Cut" \ --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": "InternRobotics/VLAC-Cut", "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 "InternRobotics/VLAC-Cut" \ --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": "InternRobotics/VLAC-Cut", "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 InternRobotics/VLAC-Cut with Docker Model Runner:
docker model run hf.co/InternRobotics/VLAC-Cut
Simplify quick start README and add explicit example commands
Browse files- quick_start/README.md +41 -43
quick_start/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
# Quick Start
|
| 2 |
|
| 3 |
-
This quick start
|
| 4 |
-
|
|
|
|
|
|
|
| 5 |
|
| 6 |
## Requirements
|
| 7 |
|
|
@@ -15,9 +17,9 @@ It samples the input video at `2 Hz` by default, sends the sampled frames and pr
|
|
| 15 |
- `opencv-python` for preview video rendering
|
| 16 |
- at least `1` GPU with enough memory for this `30B` checkpoint
|
| 17 |
|
| 18 |
-
##
|
| 19 |
|
| 20 |
-
Run
|
| 21 |
|
| 22 |
```bash
|
| 23 |
python quick_start/run_example.py \
|
|
@@ -25,60 +27,56 @@ python quick_start/run_example.py \
|
|
| 25 |
--task-instruction "把洋葱放进快递箱里。"
|
| 26 |
```
|
| 27 |
|
| 28 |
-
|
| 29 |
|
| 30 |
```bash
|
| 31 |
-
python quick_start/
|
| 32 |
-
--
|
| 33 |
-
--
|
| 34 |
```
|
| 35 |
|
| 36 |
-
If
|
| 37 |
|
| 38 |
-
|
| 39 |
-
python quick_start/run_example.py \
|
| 40 |
-
--video-path /path/to/video.mp4 \
|
| 41 |
-
--task-instruction "将三角烧杯放在三脚架上。" \
|
| 42 |
-
--task-plan $'爪夹准备移动:0%\n爪夹开始移动:10%\n爪夹靠近三角烧杯:20%\n爪夹抓取三角烧杯:40%\n爪夹合拢并靠近三脚架:60%\n爪夹移动到三脚架的正上方:80%\n爪夹松开,三角烧杯落在三脚架上:100%'
|
| 43 |
-
```
|
| 44 |
|
| 45 |
-
|
| 46 |
|
| 47 |
```bash
|
| 48 |
python quick_start/run_example.py \
|
| 49 |
-
--video-path /
|
| 50 |
-
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
```
|
| 52 |
|
| 53 |
-
|
| 54 |
|
| 55 |
```bash
|
| 56 |
python quick_start/run_example.py \
|
| 57 |
-
--
|
| 58 |
-
--
|
| 59 |
-
--task-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
```
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
By default the inference script writes:
|
| 65 |
-
|
| 66 |
-
- `quick_start/outputs/<video_stem>.jsonl`
|
| 67 |
-
|
| 68 |
-
Each output file contains one JSONL row with:
|
| 69 |
-
|
| 70 |
-
- input video path
|
| 71 |
-
- optional task instruction and task plan text
|
| 72 |
-
- sampled frame indices and timestamps
|
| 73 |
-
- decoded video statistics
|
| 74 |
-
- prompt text
|
| 75 |
-
- raw model response
|
| 76 |
-
- parsed predicted key points: `时间 / 进度`
|
| 77 |
-
|
| 78 |
-
The preview video helper writes:
|
| 79 |
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Quick Start
|
| 2 |
|
| 3 |
+
This quick start has two steps:
|
| 4 |
+
|
| 5 |
+
1. Run progress inference on a video and write one JSONL output.
|
| 6 |
+
2. Render a prediction-only preview video from that JSONL output.
|
| 7 |
|
| 8 |
## Requirements
|
| 9 |
|
|
|
|
| 17 |
- `opencv-python` for preview video rendering
|
| 18 |
- at least `1` GPU with enough memory for this `30B` checkpoint
|
| 19 |
|
| 20 |
+
## Usage
|
| 21 |
|
| 22 |
+
Run inference:
|
| 23 |
|
| 24 |
```bash
|
| 25 |
python quick_start/run_example.py \
|
|
|
|
| 27 |
--task-instruction "把洋葱放进快递箱里。"
|
| 28 |
```
|
| 29 |
|
| 30 |
+
Render a preview video:
|
| 31 |
|
| 32 |
```bash
|
| 33 |
+
python quick_start/render_prediction_video.py \
|
| 34 |
+
--input-jsonl quick_start/outputs/video.jsonl \
|
| 35 |
+
--output-video quick_start/outputs/video_pred_progress.mp4
|
| 36 |
```
|
| 37 |
|
| 38 |
+
If the model directory is not the parent of `quick_start/`, pass `--model-path`.
|
| 39 |
|
| 40 |
+
## Bundled Examples
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
+
`example_01`
|
| 43 |
|
| 44 |
```bash
|
| 45 |
python quick_start/run_example.py \
|
| 46 |
+
--video-path examples/example_01/episode.mp4 \
|
| 47 |
+
--task-instruction "抓取紫色方块使其从方形洞口落入积木桶中" \
|
| 48 |
+
--task-plan $'爪夹开始移动:0%\n爪夹接近紫色方块:20%\n爪夹抓紧紫色方块:40%\n爪夹抓紧紫色方块接近方形洞口:60%\n爪夹将紫色方块对准方形洞口:80%\n紫色方块从方形洞口落入积木桶中,爪夹移开:100%' \
|
| 49 |
+
--output-jsonl quick_start/outputs/example_01.jsonl
|
| 50 |
+
|
| 51 |
+
python quick_start/render_prediction_video.py \
|
| 52 |
+
--input-jsonl quick_start/outputs/example_01.jsonl \
|
| 53 |
+
--output-video quick_start/outputs/example_01_pred_progress.mp4
|
| 54 |
```
|
| 55 |
|
| 56 |
+
`example_02`
|
| 57 |
|
| 58 |
```bash
|
| 59 |
python quick_start/run_example.py \
|
| 60 |
+
--video-path examples/example_02/episode.mp4 \
|
| 61 |
+
--task-instruction "把洋葱放进快递箱里。" \
|
| 62 |
+
--task-plan $'开始移动:0%\n爪夹靠近洋葱:20%\n爪夹抓取洋葱:40%\n爪夹抓住洋葱接近快递箱:60%\n爪夹将洋葱放入快递箱:80%\n爪夹松开,洋葱落入快递箱:100%' \
|
| 63 |
+
--output-jsonl quick_start/outputs/example_02.jsonl
|
| 64 |
+
|
| 65 |
+
python quick_start/render_prediction_video.py \
|
| 66 |
+
--input-jsonl quick_start/outputs/example_02.jsonl \
|
| 67 |
+
--output-video quick_start/outputs/example_02_pred_progress.mp4
|
| 68 |
```
|
| 69 |
|
| 70 |
+
`example_03`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
+
```bash
|
| 73 |
+
python quick_start/run_example.py \
|
| 74 |
+
--video-path examples/example_03/episode.mp4 \
|
| 75 |
+
--task-instruction "将三角烧杯放在三脚架上。" \
|
| 76 |
+
--task-plan $'爪夹准备移动:0%\n爪夹开始移动:10%\n爪夹靠近三角烧杯:20%\n爪夹抓取三角烧杯:40%\n爪夹合拢并靠近三脚架:60%\n爪夹移动到三脚架的正上方:80%\n爪夹松开,三角烧杯落在三脚架上:100%' \
|
| 77 |
+
--output-jsonl quick_start/outputs/example_03.jsonl
|
| 78 |
|
| 79 |
+
python quick_start/render_prediction_video.py \
|
| 80 |
+
--input-jsonl quick_start/outputs/example_03.jsonl \
|
| 81 |
+
--output-video quick_start/outputs/example_03_pred_progress.mp4
|
| 82 |
+
```
|