pylabel
pylabel copied to clipboard
Fix #143
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
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.
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()