Image-Text-to-Text
Transformers
Safetensors
How to use from
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 "ReFocus/Trained_Model" \
    --host 0.0.0.0 \
    --port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "ReFocus/Trained_Model",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
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 "ReFocus/Trained_Model" \
        --host 0.0.0.0 \
        --port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "ReFocus/Trained_Model",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Quick Links

ReFocus

This repo contains the model for the paper "ReFocus: Visual Editing as a Chain of Thought for Structured Image Understanding"

๐ŸŒ Homepage |๐Ÿ“‘ Paper | ๐Ÿ”— Code

Introduction

Alt text

ReFocus Finetuning

We follow the Phi-3 Cookbook for the supervised finetuning experiments.

Inference with the Finetuned Model

We release our best finetuned ReFocus model with full chain-of-thought data in this HuggingFace Link.

This model is finetuned based on Phi-3.5-vision, and we used the following prompt during evaluation

<|image|>\n{question}\nThought:

To enforce the model to generate bounding box coordinates to refocus, you could try this prompt:

<|image_1|>\n{question}\nThought: The areas to focus on in the image have bounding box coordinates:
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Paper for ReFocus/Trained_Model