Instructions to use lulidong/PanoVideoReasoner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lulidong/PanoVideoReasoner with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="lulidong/PanoVideoReasoner") 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("lulidong/PanoVideoReasoner") model = AutoModelForMultimodalLM.from_pretrained("lulidong/PanoVideoReasoner", 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 lulidong/PanoVideoReasoner with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lulidong/PanoVideoReasoner" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lulidong/PanoVideoReasoner", "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/lulidong/PanoVideoReasoner
- SGLang
How to use lulidong/PanoVideoReasoner 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 "lulidong/PanoVideoReasoner" \ --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": "lulidong/PanoVideoReasoner", "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 "lulidong/PanoVideoReasoner" \ --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": "lulidong/PanoVideoReasoner", "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 lulidong/PanoVideoReasoner with Docker Model Runner:
docker model run hf.co/lulidong/PanoVideoReasoner
PanoVideoReasoner
PanoVideoReasoner is a panoramic video reasoning model introduced in Think in 360ยฐ: Benchmarking and Bootstrapping Panoramic Video Reasoning. It builds on Qwen3.5-9B and learns to connect observations across viewing directions and time.
The model is trained on PanoVideoCoT through Panoramic CoT SFT followed by Evidence-Privileged On-Policy Self-Distillation (EP-OPSD). PanoVideoCoT contains 13,465 questionโanswerโCoT pairs from 2,063 panoramic videos.
Quick start
Install a recent Transformers version with Qwen3.5 support, PyTorch, and the video-loading dependencies:
pip install -U "transformers>=5.15.0" accelerate torch torchvision pillow av
import torch
from transformers import AutoProcessor, Qwen3_5ForConditionalGeneration
model_path = "./PanoVideoReasoner"
processor = AutoProcessor.from_pretrained(model_path)
model = Qwen3_5ForConditionalGeneration.from_pretrained(
model_path,
dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{
"role": "user",
"content": [
{"type": "video", "path": "./panoramic_video.mp4"},
{
"type": "text",
"text": (
"This is a 360-degree panoramic video in equirectangular "
"projection (ERP). Describe how the people move through "
"the scene, following them across viewing directions."
),
},
],
}
]
inputs = processor.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_dict=True,
return_tensors="pt",
fps=1,
max_frames=128,
).to(model.device)
with torch.inference_mode():
outputs = model.generate(
**inputs,
max_new_tokens=8192,
do_sample=True,
temperature=1.0,
top_p=0.95,
top_k=20,
)
answer = outputs[:, inputs["input_ids"].shape[1]:]
print(processor.batch_decode(answer, skip_special_tokens=True)[0])
The example shows how to load the model and ask a video question. For the input protocol used in the paper, uniformly sample the complete ERP video at a target rate of 1 FPS, with at most 128 frames, and resize the long edge to 1,280 pixels. The training input budgets are 409,600 pixels per frame and 52,428,800 pixels per video. Keep the original ERP representation and its complete viewing sphere.
- Downloads last month
- -
