Skip to content

Conversation

R-N
Copy link

@R-N R-N commented Nov 27, 2023

Fixes #143

In case cat_name isn't provided, cat_id will be converted to string and used as cat_name. If this gets merged, this behavior should probably be documented though.

Next, specifying "columns=["cat_name"]" when creating dataframe from value_counts returns empty dataframe because "cat_name" became the index in value_counts. Since it's an index, the merge will have to use index too.

I'm not sure if this is a changed behavior. I'm using pandas 2.1.3

@R-N R-N marked this pull request as draft November 27, 2023 11:46
@R-N R-N marked this pull request as ready for review November 27, 2023 12:47
@R-N R-N changed the title Fix bug caused by not providing cat_name on YoloV5 #143 Fix #143 Nov 27, 2023
@alexheat
Copy link
Contributor

Thank you @R-N , how do you repro the issue that this fix fixes? Is it with importing a yolo file? Can you share a file that repros the issue.

@R-N
Copy link
Author

R-N commented Nov 28, 2023

Thank you @R-N , how do you repro the issue that this fix fixes? Is it with importing a yolo file? Can you share a file that repros the issue.

Yes I made it a repo.
https://github.com/R-N/ml_yolo_dataset

Run these in the repo:

from pylabel import importer
dataset = importer.ImportYoloV5("labels", path_to_images="../images")
dataset.splitter.StratifiedGroupShuffleSplit(train_pct=.8, val_pct=.0, test_pct=.2, batch_size=1)                                                                          
dataset.analyze.ShowClassSplits()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ShowClassSplits returning empty dataframe for YoloV5

2 participants