I wanted to know the number of vehicles in the picture using yolov5 However, the result of the model was different from detect.py
0. img
1. model_result
# Model
model = torch.hub.load('ultralytics/yolov5', 'yolov5s') # or yolov5m, yolov5l, yolov5x, custom
# Images
img = 'D:\code\YOLO\dataset\img\public02.png' # or file, Path, PIL, OpenCV, numpy, list
# Inference
results = model(img)
# Results
results.print() # or .show(), .save(), .crop(), .pandas(), etc.
result -> (no detections)
2. detect.py
from IPython.display import Image
import os
val_img_path = 'D:\code\YOLO\dataset\img\public02.png'
!python detect.py --img 416 --conf 0.25 --source "{val_img_path}"
result ->
I know that if I don't specify weight option in detect.py, the default yolo5s model is used. but, Result 1 differs from Result 2 using the same model.