File size: 730 Bytes
a985b94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from ultralytics import YOLO

def test_all_validation_images():
    print("Loading your custom-trained wafer brain...")
    # Pointing to your exact model path from earlier
    model_path = 'middleware/best.pt'
    model = YOLO(model_path)

    print("Running inference on ALL validation images...")
    # Instead of one image, we hand it the entire validation folder
    val_dir = 'data/yolo_dataset/images/val'

    # The AI will automatically loop through all 5,000+ images!
    results = model.predict(source=val_dir, save=True, conf=0.25)
    
    print("\nMassive inference complete! Look in the newest 'predict' folder to see thousands of drawn bounding boxes.")

if __name__ == '__main__':
    test_all_validation_images()