Bigyan Subedi
Bigyan Subedi

Reputation: 109

Does yolov5 pytorch use a different labeling format?

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??

Upvotes: 2

Views: 10724

Answers (2)

TkrA
TkrA

Reputation: 668

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

Upvotes: 0

yakhyo
yakhyo

Reputation: 1656

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)

Upvotes: 4

Related Questions