docs/en/datasets/segment/package-seg.md
<a href="https://colab.research.google.com/github/ultralytics/notebooks/blob/main/notebooks/how-to-train-ultralytics-yolo-on-package-segmentation-dataset.ipynb" target="_blank"></a>
The Ultralytics Package Segmentation Dataset is a curated collection of 2,197 annotated images of packages for training instance segmentation models on a single package class. Built for logistics and warehouse-automation use cases like package identification, sorting, and handling, it pairs directly with Ultralytics YOLO for real-time package analysis in computer vision pipelines. Explore more segmentation datasets on our datasets overview page.
<strong>Watch:</strong> Train a Package Segmentation Model using Ultralytics YOLO | Industrial Packages 🎉
</p>The Package Segmentation Dataset splits its 2,197 images as follows:
package class covering every annotated package.Package segmentation optimizes logistics, last-mile delivery, manufacturing quality control, and smart-city systems, with applications spanning e-commerce fulfillment and security screening. Precise package masks let automated systems locate, count, and inspect parcels in real time.
In modern warehouses, vision AI solutions can streamline operations by automating package identification and sorting. Computer vision models trained on this dataset can quickly detect and segment packages in real-time, even in challenging environments with dim lighting or cluttered spaces. This leads to faster processing times, reduced errors, and improved overall efficiency in logistics operations.
Package segmentation models can identify damaged packages by analyzing their shape and appearance. By detecting irregularities or deformations in package outlines, these models help ensure that only intact packages proceed through the supply chain, reducing customer complaints and return rates. This is a key aspect of quality control in manufacturing and is vital for maintaining product integrity.
The complete Package Segmentation Dataset can also be browsed and managed on Ultralytics Platform.
A YAML file defines the dataset configuration, including paths, classes, and other essential details. For the Package Segmentation dataset, the package-seg.yaml file is maintained at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/package-seg.yaml.
!!! example "ultralytics/cfg/datasets/package-seg.yaml"
```yaml
--8<-- "ultralytics/cfg/datasets/package-seg.yaml"
```
To train an Ultralytics YOLO26n model on the Package Segmentation dataset for 100 epochs with an image size of 640, use the following code snippets. The dataset (~103 MB) downloads automatically on first use. For a comprehensive list of available arguments, refer to the model Training page.
!!! example "Train Example"
=== "Python"
```python
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n-seg.pt") # load a pretrained segmentation model (recommended for training)
# Train the model on the Package Segmentation dataset
results = model.train(data="package-seg.yaml", epochs=100, imgsz=640)
# Validate the model
results = model.val()
# Perform inference on an image
results = model("path/to/image.jpg")
```
=== "CLI"
```bash
# Load a pretrained segmentation model and start training
yolo segment train data=package-seg.yaml model=yolo26n-seg.pt epochs=100 imgsz=640
# Resume training from the last checkpoint
yolo segment train data=package-seg.yaml model=path/to/last.pt resume=True
# Validate the trained model
yolo segment val data=package-seg.yaml model=path/to/best.pt
# Perform inference using the trained model
yolo segment predict model=path/to/best.pt source=path/to/image.jpg
```
Below is an example from the Package Segmentation Dataset with its segmentation masks overlaid, outlining detected packages:
The dataset spans varied locations, environments, and package densities, so models trained on it see the range of real-world logistics scenes they need to generalize across. See the segmentation task page for related workflows.
If you integrate the Package Segmentation dataset into your research or development initiatives, please cite the source appropriately:
!!! quote ""
=== "BibTeX"
```bibtex
@misc{ factory_package_dataset,
title = { factory_package Dataset },
type = { Open Source Dataset },
author = { factorypackage },
url = { https://universe.roboflow.com/factorypackage/factory_package },
year = { 2024 },
month = { jan },
note = { visited on 2024-01-24 },
}
```
We express our gratitude to the creators of the Package Segmentation dataset for their contribution to the computer vision community. For more datasets, visit the Ultralytics Datasets collection and our guide on model training tips.
The Package Segmentation Dataset is a collection of 2,197 annotated images of packages for training and evaluating instance segmentation models on a single package class. It targets logistics and warehouse-automation applications like package identification, sorting, and quality control, and is used directly with Ultralytics YOLO26 via the package-seg.yaml configuration file.
The dataset totals 2,197 images — 1,920 for training, 188 for validation, and 89 for testing — all annotated for a single package class. The full archive downloads automatically as a ~103 MB .zip on first use.
Load a pretrained segmentation model (e.g., yolo26n-seg.pt) and train it with the package-seg.yaml configuration using the Python or CLI snippets in the Usage section above. See the Training guide for the full list of available arguments.
YOLO26 provides state-of-the-art accuracy and real-time speed for instance segmentation, letting automated systems detect and sort packages reliably even in dim or cluttered warehouses — see the Applications section above. Trained models export to formats like ONNX and TensorRT for deployment across warehouse hardware.
The package-seg.yaml file, which defines the dataset paths and the single package class, is located in the Ultralytics GitHub repository: package-seg.yaml.