5 ‐ Generate - Af-Oliveira/WasteVision GitHub Wiki

Model Testing with generate.py

The generate.py script is designed for testing the YOLOv8 models you have trained using train.py. This script allows you to quickly evaluate your latest .pt model files on a batch of images and visualize the detection results.

1. How It Works

  • Model Selection:
    The script will use the latest YOLOv8 .pt model file you have created (typically found in your models/ directory, such as best.pt).

  • Input Images:
    It will process all images located in the input/ folder of your project.

  • Output Results:
    The script generates annotated images, detection masks, and text files with detection results, saving them in the output/ folder. This folder is created automatically by the setup.bat and can be changed in the UI provided by the generate.py. Subfolders such as overlays, detections, and masks will be created automatically for organization.

2. Usage Summary

  1. Place your test images in the input/ folder.
  2. Run the generate.py script from the main menu or directly.
  3. The script will use your latest trained .pt model and produce results in the output/ folder.