5 ‐ Generate - Af-Oliveira/WasteVision GitHub Wiki
generate.py
Model Testing with 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 yourmodels/
directory, such asbest.pt
). -
Input Images:
It will process all images located in theinput/
folder of your project. -
Output Results:
The script generates annotated images, detection masks, and text files with detection results, saving them in theoutput/
folder. This folder is created automatically by thesetup.bat
and can be changed in the UI provided by thegenerate.py
. Subfolders such asoverlays
,detections
, andmasks
will be created automatically for organization.
2. Usage Summary
- Place your test images in the
input/
folder. - Run the
generate.py
script from the main menu or directly. - The script will use your latest trained
.pt
model and produce results in theoutput/
folder.