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.

YOLO26x-P2 packaging text detections

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:

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.

Dataset Model Precision Recall Tiny-text recall Dense-page recall
Donkey test YOLO11n baseline 81.86% 98.60% 97.57% 98.93%
Donkey test YOLO26x-P2 80.62% 97.74% 96.60% 98.37%
Packaging valid YOLO11n baseline 54.24% 76.91% 54.55% 75.23%
Packaging valid YOLO26x-P2 62.13% 85.39% 71.66% 84.51%

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.

Downloads last month
57
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support