2

I am doing object detection in yolo v5 in an dataset annotated for older version .But in tutorials I found that we have to choose yolov5 pytorch format .Is there any difference ,will the older annotated data work??

Bigyan Subedi
  • 99
  • 2
  • 9

2 Answers2

4

Yes, It works. I have recently used it and labelled according to following label format:

.txt-file for each .jpg -image-file - in the same directory and with the same name, but with .txt-extension, and put to file: object number and object coordinates on this image, for each object in new line: <object-class> <x> <y> <width> <height>

Where:

- integer number of object from 0 to (classes-1) - float values relative to width and height of image, it can be equal from (0.0 to 1.0] for example: <x> = <absolute_x> / <image_width> or <height> = <absolute_height> / <image_height> atention: <x> <y> - are center of rectangle (are not top-left corner)

yakhyo
  • 1,540
  • 1
  • 6
  • 22
0

For training YOLOv5 on custom datasets (or make sure you have these):

  • First you have to create a dataset.yaml
  • Next you have to label your images, export your labels to YOLO format, with one *.txt file per image (if no objects in image, no *.txt file is required).
  • Then you need to organise your train and val images and labels accordingly.

You can find a detailed description about it here: yolov5/wiki/Train-Custom-Data

TkrA
  • 439
  • 1
  • 5
  • 19