Instructions to use abejarano/qwen25vl-container-defects-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use abejarano/qwen25vl-container-defects-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen2.5-VL-3B-Instruct-bnb-4bit") model = PeftModel.from_pretrained(base_model, "abejarano/qwen25vl-container-defects-lora") - Transformers
How to use abejarano/qwen25vl-container-defects-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="abejarano/qwen25vl-container-defects-lora") 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 AutoModel model = AutoModel.from_pretrained("abejarano/qwen25vl-container-defects-lora", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use abejarano/qwen25vl-container-defects-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "abejarano/qwen25vl-container-defects-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "abejarano/qwen25vl-container-defects-lora", "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/abejarano/qwen25vl-container-defects-lora
- SGLang
How to use abejarano/qwen25vl-container-defects-lora 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 "abejarano/qwen25vl-container-defects-lora" \ --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": "abejarano/qwen25vl-container-defects-lora", "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 "abejarano/qwen25vl-container-defects-lora" \ --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": "abejarano/qwen25vl-container-defects-lora", "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" } } ] } ] }' - Unsloth Desktop
- Docker Model Runner
How to use abejarano/qwen25vl-container-defects-lora with Docker Model Runner:
docker model run hf.co/abejarano/qwen25vl-container-defects-lora
Qwen2.5-VL-3B Container Defect Detector (LoRA)
LoRA adapter for Qwen2.5-VL-3B-Instruct, fine-tuned to detect and classify visible
defects on shipping containers (dents, rust, scratches, holes, frame damage) directly
from a photo. Built for ContainerHub.
Model Details
Model Description
Given a photo of a shipping container, the model returns a comma-separated list of
the visible defect labels (e.g. Dent, Rusty, Scratch). It is a LoRA adapter โ load
it on top of the base vision-language model, not standalone.
- Developed by: abejarano (ContainerHub)
- Model type: Vision-language model, LoRA adapter (PEFT)
- Language(s): English
- License: qwen-research (inherited from the base model)
- Finetuned from model: unsloth/Qwen2.5-VL-3B-Instruct-bnb-4bit (base:
Qwen/Qwen2.5-VL-3B-Instruct)
Model Sources
- Training data: abejarano/container-defects-qwen
Uses
Direct Use
Multi-label defect classification of shipping container photos, prompted as:
"What defect on the shipping container?" โ free-text answer listing defect labels.
Out-of-Scope Use
Not intended for defect severity grading, safety certification, or any decision where a missed or false defect classification has safety/financial consequences without human review. Not validated on container types, lighting conditions, or camera angles outside the training distribution.
Bias, Risks, and Limitations
- Trained on 1,016 images total, with no held-out validation split โ reported loss reflects training-set fit, not generalization to unseen containers.
- Early experiments (3 epochs, LoRA r=16) showed the model could hallucinate near-miss labels (e.g. "Dentation" instead of "Dent") even under greedy decoding. This version (6 epochs, LoRA r=32) fixes that on the training examples checked, but a proper eval split is still recommended before production use.
- Label vocabulary is fixed to the 5 classes present in the source dataset (Dent, Rusty, Scratch, Hole, Deframe); it will not recognize defect types outside this set.
Recommendations
Evaluate on a held-out set of container images before relying on this model for automated decisions. Keep a human in the loop for edge cases.
How to Get Started with the Model
from unsloth import FastVisionModel
from PIL import Image
model, tokenizer = FastVisionModel.from_pretrained(
"abejarano/qwen25vl-container-defects-lora",
load_in_4bit=True,
)
FastVisionModel.for_inference(model)
image = Image.open("container.jpg").convert("RGB")
messages = [
{"role": "user", "content": [
{"type": "image", "image": image},
{"type": "text", "text": "What defect on the shipping container?"},
]}
]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, tokenize=True,
return_dict=True, return_tensors="pt",
).to("cuda")
output = model.generate(**inputs, max_new_tokens=150, do_sample=False)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Training Details
Training Data
abejarano/container-defects-qwen โ
1,016 container images converted to Qwen conversational format, derived from
howell0123/shipping_container.
Labels: Dent, Rusty, Scratch, Hole, Deframe (multi-label, comma-separated).
Training Procedure
Fine-tuned with Unsloth + LoRA on a single
RTX 4090 (RunPod, unsloth/unsloth:latest template).
Preprocessing
Images decoded to PIL from the dataset's embedded bytes at load time; conversation
format {"role": ..., "content": [{"type": "image"/"text", ...}]} fed directly to
UnslothVisionDataCollator.
Training Hyperparameters
- LoRA rank (r): 32
- LoRA alpha: 32
- Target modules: all-linear (vision + language + attention + MLP layers)
- Trainable params: 82,169,856 (2.14% of 3.8B)
- Epochs: 6
- Batch size: 2 per device, gradient accumulation 4 (effective batch size 8)
- Learning rate: 2e-4, cosine schedule, 3% warmup
- Optimizer: adamw_8bit
- Training regime: bf16 mixed precision
Speeds, Sizes, Times
- Train runtime: 1942.7s (~32 min)
- Train samples/sec: 3.14
- Final train loss: 0.128 (per-step loss ~0.0002โ0.001 by the last epoch)
- Adapter size: ~329MB (
adapter_model.safetensors)
Evaluation
Informal validation only: predictions (greedy decoding) were spot-checked against ground-truth labels on training examples. No dedicated held-out evaluation split exists yet โ see Limitations above.
Environmental Impact
- Hardware Type: NVIDIA RTX 4090
- Hours used: ~0.85h GPU time across training runs
- Cloud Provider: RunPod
- Compute Region: RunPod on-demand pod (region not pinned)
Technical Specifications
Model Architecture and Objective
Qwen2.5-VL-3B-Instruct (vision-language transformer) with LoRA adapters, trained via supervised fine-tuning (SFT) framed as multi-label defect classification through free-text generation.
Compute Infrastructure
- Hardware: 1x RTX 4090 24GB, RunPod pod
- Software: unsloth 2026.5.9, transformers 4.57.6, trl (
SFTTrainer), peft 0.18.1, torch 2.10.0+cu128
Framework versions
- PEFT 0.18.1
- Downloads last month
- 12
Model tree for abejarano/qwen25vl-container-defects-lora
Base model
Qwen/Qwen2.5-VL-3B-Instruct