The Problem

Many practitioners need a quick, reproducible way to try YOLO‑v8 on a custom image set but lack a ready‑made notebook that demonstrates data loading, model selection, training, and inference in a single place.

What This Does

The repository contains a single Jupyter notebook Objectdetection_YOLOv8.ipynb that walks through the full YOLO‑v8 workflow:

  • loads a dataset (COCO‑style or folder of images),
  • creates a YOLO model object,
  • runs model.train() with user‑specified epochs and batch size,
  • evaluates with model.val(), and
  • performs inference on new images via model.predict().

The accompanying README.md provides only a title and a clone URL; it does not describe usage, dependencies, or expected data layout.

How It Is Wired

The notebook is the sole execution surface; there is no separate module hierarchy. The control flow is linear, driven by the order of cells:

  1. Import cell – imports ultralytics.YOLO and standard libraries (os, matplotlib, etc.).
  2. Data‑prep cell – defines paths such as train_path and val_path. No external configuration file is referenced, so the notebook expects the user to edit these literals.
  3. Model‑init cell – creates model = YOLO('yolov8n.pt') (or another checkpoint). This is the only place the YOLO library is instantiated.
  4. Training cell – calls model.train(data=data_cfg, epochs=E, batch=B). The data_cfg variable points to a YAML file that the user must supply; the notebook does not ship one.
  5. Validation cell – runs model.val() and prints metrics.
  6. Inference cell – executes model.predict(source=img_path, save=True) and displays results.

No functions are defined outside the notebook, and there are no imports from other repository files. Consequently, the “blast radius” of any change is confined to the notebook itself; altering a cell affects only downstream cells. Because there is no modular code, refactoring for reuse would require extracting the notebook cells into a Python module.

How To Use It

# 1. Clone the repository
git clone https://github.com/moses-y/Object-Detection-in-YOLOv8
cd Object-Detection-in-YOLOv8

# 2. Install the required library (YOLOv8 is provided by ultralytics)
pip install ultralytics==8.*  # version compatible with the notebook

Edit the notebook to point train_path, val_path, and the optional data.yaml to your dataset locations. Run the notebook cells sequentially; the final inference cell will write prediction images next to the source files.

If a data.yaml is missing, create one following YOLO‑v8 conventions:

train: /path/to/train/images
val: /path/to/val/images
nc: 80               # number of classes
names: [...]         # list of class names

Real‑World Use

A small‑scale quality‑inspection pipeline could embed this notebook in a CI step that trains a model nightly on newly labeled images, then uses the saved weights to run inference on production photos. The workflow would be scripted by launching jupyter nbconvert --to notebook --execute Objectdetection_YOLOv8.ipynb.

Code Health & Issues

  • Med – No test files – repository-wide, no automated verification of notebook behavior.
  • Med – No CI/CD pipeline – no .github/ workflows, Makefile, or other automation.
  • Med – No LICENSE – unclear rights for reuse or distribution.
  • Low – No dependency lockfile – requirements.txt or pyproject.toml absent, so exact package versions are not pinned.

No secrets were detected in the commit history.

The Bottom Line

The repo offers a single, end‑to‑end YOLO‑v8 notebook that can be useful for quick experiments, but it lacks any production‑grade scaffolding: no tests, CI, licensing, or reproducible environment definition. Engineers who need a stable, repeatable pipeline should treat the notebook as a prototype and extract its logic into a version‑controlled Python module with proper testing and dependency management.