SAVRN
Search Contact SAVRN

Open-weight model · Object detection

YOLOV8s-Barcode-Detection

by Andrea Pietrobon Piero2411/YOLOV8s-Barcode-Detection

This repository hosts a finetuned Ultralytics YOLOv8s model specifically designed for barcode and QR code classification and detection.

Parameters
Context
Weights22.5 MB
Licenseagpl-3.0
AccessOpen weights
Monthly Downloads5.2k

Model Card

By Andrea Pietrobon, published under agpl-3.0, revision 59098fa84b82.

This repository hosts a finetuned Ultralytics YOLOv8s model specifically designed for barcode and QR code classification and detection. Building upon the robust and efficient architecture of YOLOv8, this model has been fine-tuned on a comprehensive dataset of over 5,000 images, encompassing various barcode types (EAN13, Code128, etc.) and QR codes. YOLOv8 is renowned for its speed, accuracy, and ease of use, making it an excellent foundation for specialized object detection tasks like barcode and QR code recognition. This finetuned model aims to provide a reliable and performant solution for applications requiring automated barcode and QR code scanning and identification. We hope this model…

Read Andrea Pietrobon's full model card

YOLOV8s Barcode/QR Code Detection Model

Special thanks to Armaggheddon97 and his 4090
This repository hosts a finetuned [Ultralytics](https://www.ultralytics.com/) [YOLOv8s](https://github.com/ultralytics/ultralytics) model specifically designed for **barcode and QR code classification and detection**. Building upon the robust and efficient architecture of YOLOv8, this model has been fine-tuned on a comprehensive dataset of over 5,000 images, encompassing various barcode types (EAN13, Code128, etc.) and QR codes. YOLOv8 is renowned for its speed, accuracy, and ease of use, making it an excellent foundation for specialized object detection tasks like barcode and QR code recognition. This finetuned model aims to provide a reliable and performant solution for applications requiring automated barcode and QR code scanning and identification. We hope this model proves useful for your projects! For general YOLOv8 documentation, please refer to the Ultralytics Docs. For specific questions or discussions related to this finetuned model, please raise an issue on its [Hugging Face model page](https://huggingface.co/Piero2411/YOLOV8s_Barcode_Detection). ##
Documentation & Usage
Below is a quickstart guide for installing the necessary dependencies and using this finetuned model.
Install To use this model, you'll need the `ultralytics` package, which can be installed via pip. Ensure you have a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/). [![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://pepy.tech/project/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)
pip install ultralytics
For alternative installation methods or more detailed instructions on setting up your environment, please refer to the Ultralytics [Quickstart Guide](https://docs.ultralytics.com/quickstart/). [![Conda Version](https://img.shields.io/conda/vn/conda-forge/ultralytics?logo=condaforge)](https://anaconda.org/conda-forge/ultralytics) [![Docker Image Version](https://img.shields.io/docker/v/ultralytics/ultralytics?sort=semver&logo=docker)](https://hub.docker.com/r/ultralytics/ultralytics)
Usage ### CLI You can use this model directly from the Command Line Interface (CLI) using the `yolo` command. Make sure the `YOLOV8s_Barcode_Detection.pt` model file is accessible in your current directory or specified with its full path.
yolo predict model=YOLOV8s_Barcode_Detection.pt source='path/to/your/image.jpg'
The `yolo` command offers various modes and arguments (e.g., `imgsz=640`). For more details, consult the YOLOv8 [CLI Docs](https://docs.ultralytics.com/usage/cli/). ### Python This model can also be easily integrated into your Python applications. The usage mirrors the standard Ultralytics YOLO API.
from ultralytics import YOLO

# Load your finetuned model
model = YOLO("YOLOV8s_Barcode_Detection.pt")

# Perform object detection on an image
results = model("path/to/image.jpg")

# Optionally, visualize the results
results[0].show()

# You can also export the model to other formats (e.g., ONNX)
# This is useful for deployment in various environments.
# path = model.export(format="onnx") # uncomment to export
For more advanced Python usage, including training, validation, and different prediction modes, refer to the YOLOv8 [Python Docs](https://docs.ultralytics.com/usage/python/).
##
Model Details
This specific model, `YOLOV8s_Barcode_Detection.pt`, is a finetuned instance of the **YOLOv8s (small) detection model**. It has been specifically trained for **barcode and QR code classification and detection**. ### Dataset The model was finetuned on a custom dataset comprising **over 5,000 images**. This dataset includes a wide variety of barcode types such as EAN13, Code128, and many more, alongside various QR code instances, ensuring robustness across different real-world scenarios. ### Training Parameters The training process leveraged a pre-trained `yolov8s.pt` checkpoint and was conducted with the following key parameters:
# Base model used for finetuning
model = YOLO('yolov8s.pt') 

# Training parameters
results = model.train(
    data='dataset/data_autosplit.yaml', # Path to the custom dataset
    epochs=30,           # Number of training epochs
    patience=10,         # Early stopping patience
    batch=16,            # Batch size (adjust based on GPU memory)
    imgsz=640,           # Image size for training
    name='yolov8_large_dataset_v1', # Run name

    # Augmentation parameters
    degrees=180,         # Random rotation (0-180 degrees)
    translate=0.1,       # Image translation (0-1)
    scale=0.5,           # Image scaling (0-1)
    shear=10,            # Image shearing (degrees)
    perspective=0.001,   # Image perspective (0-0.001)
    fliplr=0.5,          # Horizontal flip (probability)
    flipud=0.5,          # Vertical flip (probability)
    cutmix=0.2,          # CutMix augmentation (probability)
)
The combination of a robust base model, a diverse custom dataset, and carefully selected training parameters aims to provide high accuracy and generalization for barcode and QR code detection across various real-world scenarios. While the table below provides a general overview of the YOLOv8s base model's performance on the COCO dataset, which serves as a reference for its architectural capabilities. **Please note that the performance metrics for `YOLOV8s_Barcode_Detection.pt` will differ, reflecting its specialized training on barcode and QR code data.**
Base YOLOv8s Detection (COCO Reference) See [Detection Docs](https://docs.ultralytics.com/tasks/detect/) for usage examples with these models trained on [COCO](https://docs.ultralytics.com/datasets/detect/coco/), which include 80 pre-trained classes. | Model | size
(pixels) | mAPval
50-95 | Speed
CPU ONNX
(ms) | Speed
A100 TensorRT
(ms) | params
(M) | FLOPs
(B) | | ------------------------------------------------------------------------------------ | --------------------- | -------------------- | ------------------------------ | ----------------------------------- | ------------------ | ----------------- | | [YOLOv8s](https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8s.pt) | 640 | 44.9 | 128.4 | 1.20 | 11.2 | 28.6 | - **mAPval** values are for single-model single-scale on [COCO val2017](https://cocodataset.org/) dataset.
Reproduce by `yolo val detect data=coco.yaml device=0` - **Speed** averaged over COCO val images using an [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) instance.
Reproduce by `yolo val detect data=coco.yaml batch=1 device=0|cpu`
##
Performance and Results
Below are the key performance metrics and visualizations from the training and validation of the `YOLOV8s_Barcode_Detection.pt` model. ### Key Metrics from Training (Last Epoch) | Metric | Value | | :----------------------- | :------ | | `metrics/precision(B)` | 0.97545 | | `metrics/recall(B)` | 0.99127 | | `metrics/mAP50(B)` | 0.98643 | | `metrics/mAP50-95(B)` | 0.77643 | | `val/box_loss` | 0.988 | | `val/cls_loss` | 0.43007 | | `val/dfl_loss` | 1.11172 | These metrics demonstrate the model's high precision and recall, especially at an IoU threshold of 0.5 (mAP50), indicating excellent performance in detecting both barcode and QR code instances. ### Visual Results Here are various plots generated during the training process, providing deeper insights into the model's performance and behavior: | Plot Type | Description | Image | | :--------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **F1-Confidence Curve** | This curve shows the F1 score across different confidence thresholds for both barcode and QR code classes, as well as the overall F1 score. The peak F1 of `0.98` is achieved at a confidence of `0.553`. | | | **Precision-Confidence Curve** | This plot illustrates how precision changes with varying confidence thresholds. A high precision of `1.00` is achieved at a confidence of `0.928`. | | | **Precision-Recall Curve** | The Precision-Recall curve highlights the trade-off between precision and recall. The model achieved an impressive overall `[email protected]` of `0.986`, with individual class scores of `0.979` for barcode and `0.992` for qrcode. | | | **Recall-Confidence Curve** | This curve shows the recall performance at different confidence thresholds. | | | **Confusion Matrix (Normalized)** | The normalized confusion matrix shows the proportion of true positives, false positives, and false negatives for each class, normalized by the true class count. | | | **Confusion Matrix (Absolute Counts)** | The absolute confusion matrix shows the raw counts of true positives, false positives, and false negatives for each class. | | | **Dataset Distribution** | This plot provides insights into the distribution of instances within the dataset, including class counts, bounding box shapes, and centroid locations. | | | **Training & Validation Curves** | These plots track the training and validation losses (box, classification, DFL) and performance metrics (precision, recall, mAP) across all epochs, demonstrating the model's learning progression. | | #### Example Prediction Batches Visual examples of the model's predictions on validation images, showing detected bounding boxes and class labels (before and after confidence thresholding for clarity).
Labeled Predictions (Ground Truth)
Predicted Bounding Boxes (with Confidence)
##
License
Ultralytics offers two licensing options to accommodate diverse use cases: - **AGPL-3.0 License**: This [OSI-approved](https://opensource.org/license) open-source license is ideal for students and enthusiasts, promoting open collaboration and knowledge sharing. See the [LICENSE](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) file for more details. –––

Identity and Version

Repository
Piero2411/YOLOV8s-Barcode-Detection
Publisher
Andrea Pietrobon
Task
Object detection
Modality
Image
Library
ultralytics
Parameters
Not stated by the source
Languages
obb
Revision
59098fa84b8258fdffdc632e36482dcbf78fc5f4
First published
2025-07-29
Last updated
2025-09-01

Files and Weights

25 files, 29.9 MB in total. The weights are 1 file totalling 22.5 MB in pt.

Weights1 file · 22.5 MB
Configuration1 file · 1.6 KB
Documentation1 file · 15.9 KB
Other21 files · 7.4 MB
Repository1 file · 3.0 KB
Every file
FileTypeSizeSHA-256
YOLOV8s_Barcode_Detection.ptWeights22.5 MB 316ded312281
yolov8_large_dataset_v3/args.yamlConfiguration1.6 KB
README.mdDocumentation15.9 KB
yolov8_large_dataset_v3/BoxF1_curve.pngOther150.7 KB a6bcc3ca5d4f
yolov8_large_dataset_v3/BoxPR_curve.pngOther96.5 KB
yolov8_large_dataset_v3/BoxP_curve.pngOther114.9 KB 4019698956e9
yolov8_large_dataset_v3/BoxR_curve.pngOther131.7 KB e562197739cf
yolov8_large_dataset_v3/confusion_matrix.pngOther114.2 KB fcf6b99ee5a4
yolov8_large_dataset_v3/confusion_matrix_normalized.pngOther117.5 KB 721a2142a8eb
yolov8_large_dataset_v3/labels.jpgOther202.6 KB 86f6b3362988
yolov8_large_dataset_v3/results.csvOther3.9 KB
yolov8_large_dataset_v3/results.pngOther286.6 KB 3a14866c72dd
yolov8_large_dataset_v3/train_batch0.jpgOther589.6 KB 1113ce4195aa
yolov8_large_dataset_v3/train_batch1.jpgOther587.8 KB c654c2e8e277
yolov8_large_dataset_v3/train_batch2.jpgOther560.6 KB d1523de9f67b
yolov8_large_dataset_v3/train_batch2860.jpgOther491.9 KB 3127b8e5f7d4
yolov8_large_dataset_v3/train_batch2861.jpgOther502.0 KB 51428f11f6e8
yolov8_large_dataset_v3/train_batch2862.jpgOther477.2 KB a6b5a91cb6fc
yolov8_large_dataset_v3/val_batch0_labels.jpgOther483.4 KB 4cd681763a25
yolov8_large_dataset_v3/val_batch0_pred.jpgOther499.4 KB e75b087793f4
yolov8_large_dataset_v3/val_batch1_labels.jpgOther495.2 KB 6e219212d364
yolov8_large_dataset_v3/val_batch1_pred.jpgOther507.1 KB 78aa135e43db
yolov8_large_dataset_v3/val_batch2_labels.jpgOther498.8 KB c504b52d5a05
yolov8_large_dataset_v3/val_batch2_pred.jpgOther511.1 KB b99fa0e37c03
.gitattributesRepository3.0 KB

License and Download

License
agpl-3.0
Access
Open weights, no gate
Download size
22.5 MB
Download from Andrea Pietrobon

Released by Andrea Pietrobon through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published22.5 MB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About YOLOV8s-Barcode-Detection

Can I use YOLOV8s-Barcode-Detection commercially?

Yes, with conditions. YOLOV8s-Barcode-Detection is released under GNU Affero General Public License 3.0. The AGPL 3.0 is a strong copyleft license. Commercial use is allowed, but a modified version made available to users over a network must be released with its source code under the same license.

Similar Models

Model · Object detection

locate-anything.cpp-gguf

Mudler

GGUF builds of nvidia/LocateAnything-3B for locate-anything.cpp - a C++/ggml inference engine for open-vocabulary detection / visual grounding, no Python at inference time. Brought to you by the LocalAI team. The detections are the same as the official PyTorch implementation (the engine is parity-gated against it), and it runs faster - on CPU and GPU. The full-precision f32 GGUF (~15 GB) is reproducible from the HF weights with scripts/convertlocateanythingtogguf.py in the repo. Same detections as the official model, faster. Full methodology, the warm/median setup, parity checks, and more images are in the repo's Slow-mode inference on the 448 fixture; vs official divides the official…

Open weights other gguf

Model · Object detection

Anzhcs_YOLOs

Anzhc

YOLOs in this repo are trained with datasets that i have annotated myself, or with the help of my friends(They will be appropriately mentioned in those cases). YOLOs on open datasets will have their own pages. Ultralytics 8.3.217 updates mask handling, which breaks function in main Adetailer repo. Install Ultralytics==8.3.216 or lower. Alternatively - use forks that fix this. - Fixed in main repo. I've added some features to make Adetailer more usable and less manual - https://github.com/Anzhc/aadetailer-reforge Im open to commissions, hit me up in Discord - anzhc P.S. All model names in tables have download links attached:3 Series of models aiming at detecting and segmenting face…

Open weights agpl-3.0 ultralytics

This is a fine-tuned version of YOLOv11 (n, s, m, l, x) specialized for License Plate Detection, using a public dataset from Roboflow Universe: The upstream Roboflow dataset (license-plate-recognition-rxg4e) contains train/test contamination — the same source images appear in both the training and test splits with only minor manual augmentation applied (see Discussion #2 for concrete examples). As a result: - The reported metrics below are likely overestimated, because the test set is not a true held-out evaluation. - Real-world generalization performance is expected to be lower than the numbers in the table. - Treat all evaluation figures with caution and validate the model on your own…

Open weights agpl-3.0 ultralytics

Model · Object detection

surya_layout2

Datalab

A lightweight document layout detection model used by Surya. It detects layout regions (text, tables, figures, headers, captions, equations, etc.) on a page image and runs on CPU or GPU. This is the "fast" layout detector — a compact object detector that serves as a drop-in alternative to Surya's VLM-based layout model. Documentation, installation, and everything else lives in the Point the fast layout predictor at this checkpoint: Or make it the default so the CLI and library use it without an explicit path: Released under the AI Pubs OpenRAIL-M license (see LICENSE) — the same license as the surya-ocr-2 model weights.

Open weights openrail surya

Model · Object detection

detr-resnet-50

Joshua

https://huggingface.co/facebook/detr-resnet-50 with ONNX weights to be compatible with Transformers.js. If you haven't already, you can install the Transformers.js JavaScript library from NPM using: Test it out here, or create your own object-detection demo with 1 click! Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Open weights 1,024 tokens transformers.js