average23/yolo26x-p2-packaging-text-detection
YOLO26x-P2 Packaging Text Detection
YOLO26x-P2 detector fine-tuned for locating text regions in packaging, documents, screenshots, and natural-scene images. The model predicts axis-aligned text bounding boxes and does not recognize the text itself.
The P2 detection head and 1024 px training resolution target small and dense text that would otherwise be clipped before OCR.
Example from the Food Packaging OCR Dataset v2 validation split. Red boxes are the model predictions at conf=0.35; ground-truth annotations are not shown.
Files
best.pt— production checkpoint.packaging-text-detection-showcase.jpg— prediction visualization.training-config.yaml— reproducible training summary.benchmark-comparison.json— detailed benchmark counts and metrics.SHA256SUMS— artifact checksums.
Usage
from ultralytics import YOLO
model = YOLO("best.pt")
results = model.predict(
source="image.jpg",
imgsz=1024,
conf=0.05,
iou=0.5,
max_det=2000,
end2end=False,
)
for result in results:
for box in result.boxes:
print(box.xyxy[0].tolist(), float(box.conf[0]))conf=0.05 is the high-recall benchmark setting. Calibrate the threshold on your production layouts if false positives are more expensive than missed text.
Training
- Architecture: YOLO26x-P2
- Parameters before fusion: approximately 57.8M
- Image size: 1024
- Batch size: 2
- Optimizer: AdamW
- Training framework: Ultralytics 8.4.107
- Early stopping: best result at stage-two epoch 6; stopped after epoch 10
- Hardware: NVIDIA GeForce RTX 5070 Ti 16 GB
Training data:
- DonkeySmall/Yolo-Text-Detection, MIT license.
- Food Packaging OCR Dataset v2, CC BY 4.0.
The Food Packaging training split contributed 8,730 unique images and 224,615 text boxes after removing ignored regions and exact duplicates. Its validation split was kept out of training.
Evaluation
All comparison runs used imgsz=1024, conf=0.05, and IoU 0.5.
On the packaging holdout, YOLO26x-P2 improves tiny-text recall by 17.11 percentage points and reduces false positives by 19.79% relative to the YOLO11n baseline.
Ultralytics validation for the selected checkpoint reported:
- Precision: 95.19%
- Recall: 92.89%
- mAP50: 97.63%
- mAP50-95: 79.17%
These Ultralytics metrics and the comparison table use different evaluation contracts and should not be compared directly.
Limitations
- Outputs axis-aligned boxes, not oriented polygons.
- Optimized for high recall; threshold calibration is application-specific.
- Logos and decorative lettering may still produce false positives.
- Text recognition requires a separate OCR model.
- Validate crop padding and tile-boundary merging on your own layouts.
License
The checkpoint is published under AGPL-3.0 because it was produced with the Ultralytics training stack. Commercial or closed-source deployment may require an Ultralytics Enterprise License.
