-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Troubles running 'remap_labels' on ProjectDataset #402
Comments
As a workaround I am running this instead import datumaro.plugins.transforms as transforms
dataset = transforms.RemapLabels(dataset,
mapping={'cat': 'dog', # rename cat to dog
'truck': 'car', # rename truck to car
'person': '', # remove this label
}, default='delete') This seems to get me past that step, but it changes the type of the dataset to a |
Alright, well that bombed when I tried to export the dataset. I'll keep looking for a solution. Any help on what I'm doing wrong or what I could correct would be great. Thanks! |
Hi, thanks for reporting the problem with the example. Yes, it looks like # Just pass the transform class in the example code instead of string
dataset.transform(project.env.transforms['remap_labels'],
# or
from datumaro.plugins.transforms import RemapLabels
dataset.transform(RemapLabels,
# but it will just do what you did in the workaround, i.e. it will not return a Dataset instance
# Continue the workaround you tried with
dataset = Dataset.from_extractors(dataset)
dataset.export('path/', 'format_name')
# or (answering your question about getting a Dataset from ProjectDataset)
dataset = Dataset.from_extractors(project.make_dataset())
... # the example code All of this will produce the same results. |
In this example, the dataset given from
project.make_dataset()
returns a ProjectDataset, I am not able to runremap_labels
on this dataset as it just returns aTypeError: 'str' object is not callable
. I looked through the tests and it looks like all the tests are runningremap_labels
ondatumaro.components.dataset.Dataset
objects and I don't see any tests/examples running ondatumaro.components.project.ProjectDataset
.I'm not sure if I'm doing something wrong, but just running this example on the master and development branch seems to give me the same
TypeError: 'str' object is not callable
error.If I use the
dataset.Dataset
class it works fine, but I'm not sure how to take a ProjectDataset and turn it into just aDataset
The text was updated successfully, but these errors were encountered: