Skip to content
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

thing_classes=['', '', '', '', '', '', ''] is empty #4647

Open
Nabil-Miri opened this issue Nov 7, 2022 · 3 comments
Open

thing_classes=['', '', '', '', '', '', ''] is empty #4647

Nabil-Miri opened this issue Nov 7, 2022 · 3 comments

Comments

@Nabil-Miri
Copy link

Nabil-Miri commented Nov 7, 2022

Hello, when I register my dataset which is in the COCO JSON format and MetadataCatalog it, i get empty classes

import json
from detectron2.data import MetadataCatalog, DatasetCatalog
from detectron2.data.datasets import register_coco_instances
register_coco_instances('train',{},'/content/SplittedData/train.json', '/content/TACO/data')
_dataset_metadata_train = MetadataCatalog.get('train')

image

My JSON file: https://drive.google.com/file/d/1jnDJZswSGn0TZiYlZoApj2WfERoprhwG/view?usp=share_link

##Environment:
Google COLAB

@github-actions github-actions bot added the needs-more-info More info is needed to complete the issue label Nov 7, 2022
@github-actions
Copy link

github-actions bot commented Nov 7, 2022

You've chosen to report an unexpected problem or bug. Unless you already know the root cause of it, please include details about it by filling the issue template.
The following information is missing: "Instructions To Reproduce the Issue and Full Logs"; "Your Environment";

@github-actions github-actions bot removed the needs-more-info More info is needed to complete the issue label Nov 7, 2022
@Prayag22
Copy link

try this to better understand your problem
print(_dataset_metadata_train)

@Nabil-Miri
Copy link
Author

Nabil-Miri commented Dec 8, 2023

Thanks for the response. This work was last year and it was fixed by adding them manually:

from detectron2.data.catalog import Metadata
import cv2, cv2_imshow
my_metadata = Metadata()
my_metadata.set(thing_classes=['metals_and_plastics', 'other', 'non-recyclable', 'glass', 'paper', 'bio', 'unknown'])

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

No branches or pull requests

2 participants