How to save YOLOv5 results in a single directory with custom filenames?

52 views Asked by At

I am using the YOLOv5 model in PyTorch. The following code snippet saves the results, but it creates a separate folder for each image in the specified directory. How can I save all images in the same folder?

results = self.yolov5_model(rendered_image_pil)
# Results
idx = offset + pos
filename = f"rendered_{idx:04}"
results.save(save_dir='output/detect/images')
0

There are 0 answers