roboflow-python icon indicating copy to clipboard operation
roboflow-python copied to clipboard

Wrong number of classes in data.yaml

Open sannicosan opened this issue 2 years ago • 7 comments

Description

After labelling all the images in the dataset, when generating a new dataset version and downloading it, the data.yaml created additional non-existing classes.

Steps to reproduce

  1. Label your data
  2. Create a new dataset version
  3. Check the Modify Classses pre-processing step to make sure you have the right classes
  4. Generate the dataset version
  5. Download the dataset
  6. Check the classes in data.yaml

Expected result

You should only get the classes that you labeled

Actual result

The roboflow creates additional non-existing classes (this also alters the class_id of the real classes)

Note: While labeling, there were some classes that were created by mistake, but they were deleted afterwards since they were never used. This somehow was still picked up by the roboflow.

Evidence

You can clearly see I had 2 classes: image

When downloading the dataset, its data.yaml config file looked like this: image

This remapped my original class_id's of course. This was my original data.yaml:

image

sannicosan avatar Dec 21 '22 17:12 sannicosan

Additional info: As a workaround, I tried to explicitly use the 'Modify class' functionality to make sure the classes were correct. I set this step before generating a new dataset version, and still the data.yaml picked up new classes out of nowhere. You can observe this here:

image

sannicosan avatar Dec 21 '22 17:12 sannicosan

Thanks @sannicosan for opening the issue, I've escalated this internally and we will reply soon :)

Here I attach another evidence of how the unexisting/unused class appears out of nowhere: https://www.loom.com/share/4f17714fa0f34bcc9e0cfd9b2808be76

sannicosan avatar Jan 05 '23 23:01 sannicosan

hey @sannicosan could you please add [email protected] to your workspace?

Done: https://app.roboflow.com/final-project-object-detection-for-instore-inventory-management

sannicosan avatar Jan 10 '23 14:01 sannicosan

Hi @sannicosan! I took a look at your project, and I was able to export a version while dropping the 'typo class'. Not sure why the '/' class didn't show up in your class remapping window.

Screenshot 2023-01-10 at 2 30 20 PM

Checkout version 28 and see if that gets you what you need.

paulguerrie avatar Jan 10 '23 21:01 paulguerrie

Hello,

The same thing is happening to our data set. We have 5 labels for objects we are looking for circles of color: blue, red, purple, orange, yellow. After running through RoboFlow to convert the Pascal VOC labels to .txt for yoloV8, the data set .txt labels had 10 classes. It created a red-circle, blue-circle, ... etc. The new classes that appear out of nowhere are being assigned to some of the classes have labeled. There is an option to delete classes after the creation of all the .txt files. Does this delete all the false class created to replace them back to what they need to be. Meaning class "blue-circle" will revert back to "blue"

SalmanSattar24 avatar Jan 13 '24 04:01 SalmanSattar24