# AI use cases for Ultralytics (ultralytics/ultralytics)

Repo: [ultralytics/ultralytics](https://github.com/ultralytics/ultralytics) | Use cases: 3 | Page: https://dedupedai.com/use-cases/ultralytics-ultralytics/

Ultralytics is the package behind the YOLO family of computer vision models, up to YOLO26. One `pip install ultralytics` gives you a `yolo` CLI and a Python API for detection, segmentation and more: predict on images, train on your own dataset, validate, and export to formats like ONNX. It is AGPL-3.0 with an enterprise license for commercial use.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Detect objects in an image with one command: https://dedupedai.com/use-cases/ultralytics-ultralytics/detect-objects-in-an-image-with-yolo-cli/
- Train and validate a YOLO model on your dataset: https://dedupedai.com/use-cases/ultralytics-ultralytics/train-a-custom-yolo-model-in-python/
- Export a YOLO model to ONNX for deployment: https://dedupedai.com/use-cases/ultralytics-ultralytics/export-a-yolo-model-to-onnx-for-deployment/

## How to detect objects in an image with one command with Ultralytics

Repo: [ultralytics/ultralytics](https://github.com/ultralytics/ultralytics) | Difficulty: Beginner | Time: 10 minutes | Basis: From the README

Run a pretrained YOLO26n model on any image from the terminal.

**Who it is for:** A developer who wants to see what a detector finds before writing code.

**The problem:** Setting up a vision model usually takes an afternoon.

**The outcome:** An annotated prediction for the image, with boxes and class labels.

### Steps

1. Install with `pip install ultralytics`
2. Run `yolo predict model=yolo26n.pt source='https://ultralytics.com/images/bus.jpg'`
3. Replace the source with your own image path or URL
4. Add arguments like imgsz=640 to tune the run

### Prompt to paste into your agent

```text
Using ultralytics/ultralytics, install `pip install ultralytics`, run `yolo predict model=yolo26n.pt source='https://ultralytics.com/images/bus.jpg'` and then on <my image folder>, and summarise which objects were found in each image.
```

### Caveat

The model weights download on first use.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/ultralytics-ultralytics/detect-objects-in-an-image-with-yolo-cli/

## How to train and validate a YOLO model on your dataset with Ultralytics

Repo: [ultralytics/ultralytics](https://github.com/ultralytics/ultralytics) | Difficulty: Intermediate | Time: 1 to 3 hours | Basis: From the README

Fine-tune YOLO26n on a dataset config, then check its metrics on the validation set.

**Who it is for:** A team building detection for its own objects, like products on a shelf.

**The problem:** Pretrained classes rarely match the objects you care about.

**The outcome:** A trained model with validation metrics.

### Steps

1. Install with `pip install ultralytics`
2. In Python load the model with YOLO("yolo26n.pt")
3. Call model.train with data set to your dataset yaml (the README uses coco8.yaml), epochs and imgsz
4. Call model.val() to evaluate on the validation set

### Prompt to paste into your agent

```text
With ultralytics/ultralytics, write a Python script that loads YOLO("yolo26n.pt"), trains on <my dataset yaml> for 100 epochs at imgsz 640 like the README example, runs model.val(), and prints the key metrics.
```

### Caveat

Training on CPU works per the README example but is slow.

Risk, platform: AGPL-3.0: commercial closed-source use needs an Ultralytics enterprise license.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/ultralytics-ultralytics/train-a-custom-yolo-model-in-python/

## How to export a YOLO model to ONNX for deployment with Ultralytics

Repo: [ultralytics/ultralytics](https://github.com/ultralytics/ultralytics) | Difficulty: Intermediate | Time: 20 minutes | Basis: From the README

Turn a trained YOLO model into an ONNX file you can run outside PyTorch.

**Who it is for:** An engineer deploying detection to a server or edge device.

**The problem:** PyTorch checkpoints are awkward to ship to production runtimes.

**The outcome:** An ONNX model file and its path.

### Steps

1. Install with `pip install ultralytics`
2. Load your trained model with YOLO
3. Call model.export(format="onnx"), which returns the path to the exported model
4. Load the ONNX file in your deployment runtime

### Prompt to paste into your agent

```text
Using ultralytics/ultralytics, load <my trained weights>, export them with model.export(format="onnx"), and show me how to run the ONNX file on one image.
```

### Caveat

This card is written from the ultralytics/ultralytics README, not from a test run by Deduped. Before you start, make sure you have Python 3.8 or newer with pip. Check the repo for newer instructions before you rely on these steps.

Risk, platform: AGPL-3.0 applies to deployments too; check the license before shipping a closed product.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/ultralytics-ultralytics/export-a-yolo-model-to-onnx-for-deployment/
