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

custom importer/extractor not loading? #404

Closed
jonnyyu opened this issue Aug 11, 2021 · 1 comment · Fixed by #406
Closed

custom importer/extractor not loading? #404

jonnyyu opened this issue Aug 11, 2021 · 1 comment · Fixed by #406
Labels
BUG Something isn't working

Comments

@jonnyyu
Copy link

jonnyyu commented Aug 11, 2021

Hi,
I saw there's a comment about how to add a custom importer/extractor, but it seems not working.

<project_dir>/.datumaro/extractors

I tried putting myimporter.py to .datumaro/importers folder

from datumaro.components.extractor import Importer

class MyImporter(Importer):
    @classmethod
    def find_sources(cls, path):
        return []

then run following code in python interactive under project root.

>>> from datumaro.components.environment import Environment
>>> env = Environment()
>>> print([importer for importer in env.importers])
>>> ['imagenet_txt', 'yolo', 'cityscapes', 'label_me', 'coco_captions', 'coco_image_info', 'coco', 'coco_instances', 'coco_labels', 'coco_panoptic', 
'coco_person_keypoints', 'coco_stuff', 'cifar', 'image_dir', 'wider_face', 'lfw', 'sly_pointcloud', 'market1501', 'image_zip', 'mot_seq', 'kitti_
detection', 'kitti', 'kitti_segmentation', 'kitti_raw', 'cvat', 'mots', 'imagenet', 'open_images', 'mnist_csv', 'datumaro', 'vgg_face2', 'mnist',
 'voc_action', 'voc_classification', 'voc_detection', 'voc', 'voc_layout', 'voc_segmentation', 'icdar_text_localization', 'icdar_text_segmentatio
n', 'icdar_word_recognition', 'camvid']

Then I tried force loading plugin from the specific directory

>>>  env.load_plugins('.datumaro/importers')
>>> print([importer for importer in env.importers])
['imagenet_txt', 'yolo', 'cityscapes', 'label_me', 'coco_captions', 'coco_image_info', 'coco', 'coco_instances', 'coco_labels', 'coco_panoptic', 
'coco_person_keypoints', 'coco_stuff', 'cifar', 'image_dir', 'wider_face', 'lfw', 'sly_pointcloud', 'market1501', 'image_zip', 'mot_seq', 'kitti_
detection', 'kitti', 'kitti_segmentation', 'kitti_raw', 'cvat', 'mots', 'imagenet', 'open_images', 'mnist_csv', 'datumaro', 'vgg_face2', 'mnist',
 'voc_action', 'voc_classification', 'voc_detection', 'voc', 'voc_layout', 'voc_segmentation', 'icdar_text_localization', 'icdar_text_segmentatio
n', 'icdar_word_recognition', 'camvid', 'my']
@zhiltsov-max
Copy link
Contributor

Hi, it looks like the plugin directory was overlooked in the last implementation update. It should be called here:
https://github.com/openvinotoolkit/datumaro/blob/develop/datumaro/components/project.py#L417

<project_dir>/.datumaro/extractors should be <project_dir>/.datumaro/plugins now.

Thank you for reporting the issue!

@zhiltsov-max zhiltsov-max added the BUG Something isn't working label Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants