A LoRA adapter for Qwen3-VL-4B-Instruct that classifies a cropped food image as A = single dish or B = multiple dishes. It judges the main food container at the center and ignores neighboring foods cut off at the crop edges.
The example maps A to single-dish and B to multi-dish, and retains the raw model text. A response that does not start with either letter is reported as unknown.
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-4B-Instruct