I’m trying to train a yolov7 pretrained model to perform object detection in the dataset i’ve created but despite everything seemingly working until the training, when i try to test the results it only returns the images from the test set without any bounding boxes
I’ve tried doing everything exactly the same but with another dataset of the same size and it works properly with it, My dataset is for spy camera detection it contains 300 images, i’m working on google colab and the code I’m using is the following:
!git clone https://github.com/WongKinYiu/yolov7
%cd /content/yolov7
!pip install -r requirements.txt
!pip install roboflow
from roboflow import Roboflow
rf = Roboflow(api_key="7I60qffNU9N77bb0sSr7")
project = rf.workspace("myworkspace-anl7e").project("spycamfinder")
version = project.version(1)
dataset = version.download("yolov7")
%cd /content/yolov7
!wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt
%cd /content/yolov7
!python train.py --batch 16 --cfg cfg/training/yolov7.yaml --epochs 100 --data {dataset.location}/data.yaml --weights 'yolov7.pt' --device 0
!python detect.py --weights runs/train/exp/weights/best.pt --conf 0.1 --source {dataset.location}/test/images
#display inference on ALL test images
import glob
from IPython.display import Image, display
i = 0
limit = 10000 # max images to print
for imageName in glob.glob('/content/yolov7/runs/detect/exp/*.jpg'): #assuming JPG
if i < limit:
display(Image(filename=imageName))
print("n")
i = i + 1
Diana Hurtado is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.