A LoRA adapter for Qwen3-VL-8B-Instruct that locates individual dishes in a cropped food image. It outputs bounding boxes for each dish.
The script prints JSON with the raw model text, pixel boxes (boxes_xyxy_pixels) and normalized boxes (boxes_xyxy_normalized). Coordinates are ordered [x1, y1, x2, y2]. It preserves the paper's conversion heuristic: raw values exceeding 1.05 times the image's largest dimension are treated as 0–1000 coordinates; otherwise as pixels. This can be ambiguous for some image sizes and boxes.
Run from this directory. The script loads the required Qwen base model and this PEFT LoRA adapter.
python -m pip install -r requirements.txt
python infer.py --image /path/to/food_crop.jpg --device cuda:0
CUDA inference uses one GPU in BF16. For CPU inference, use --device cpu (float32; more RAM required). Training photos are not included.
Automating Dish-Level Annotation of Real Food-Diary Photos
Adapter weights and inference code: Apache-2.0. The Qwen base model is separately distributed under Apache-2.0.
Qwen/Qwen3-VL-8B-Instruct