Class YoloV5 中使用 Ultralytics 代码的标签顺序
Class label order in YoloV5 using Ultralytics code
我正在尝试使用 Ultralytics open-source research. I encountered this problem at the step where we have to generate a .yaml file here 训练自定义对象检测器。这些标签名称的顺序应该是什么?它不像我们在 Tensorflow 中那样按字母顺序排列。我不希望我的模型在推理过程中贴错标签。
顺序随意。你可以选择任何你想要的。相关部分是,在 next step 中,您必须为每个图像提供 .txt
,其中:
Each row is class x_center y_center width height
format.
在这种情况下,class
将是 0 到 N-1 之间的整数,其中 N 是您在 .yaml
文件中定义的 类 的数量。
因此,如果在 .yaml
文件中您有:
nc: 3
classes: ['cat', 'dog', 'car']
并且在 my_image.txt
你有:
0 0.156 0.321 0.254 0.198
2 0.574 0.687 0.115 0.301
那么,这意味着,在这张图中,你有一个cat
和一个car
。
我正在尝试使用 Ultralytics open-source research. I encountered this problem at the step where we have to generate a .yaml file here 训练自定义对象检测器。这些标签名称的顺序应该是什么?它不像我们在 Tensorflow 中那样按字母顺序排列。我不希望我的模型在推理过程中贴错标签。
顺序随意。你可以选择任何你想要的。相关部分是,在 next step 中,您必须为每个图像提供 .txt
,其中:
Each row is
class x_center y_center width height
format.
在这种情况下,class
将是 0 到 N-1 之间的整数,其中 N 是您在 .yaml
文件中定义的 类 的数量。
因此,如果在 .yaml
文件中您有:
nc: 3
classes: ['cat', 'dog', 'car']
并且在 my_image.txt
你有:
0 0.156 0.321 0.254 0.198
2 0.574 0.687 0.115 0.301
那么,这意味着,在这张图中,你有一个cat
和一个car
。