Skip to content

remove unnecessary file when loading custom ImageNet#75

Merged
fra31 merged 1 commit intoRobustBench:masterfrom
CNOCycle:master
Apr 21, 2022
Merged

remove unnecessary file when loading custom ImageNet#75
fra31 merged 1 commit intoRobustBench:masterfrom
CNOCycle:master

Conversation

@CNOCycle
Copy link
Contributor

As shown in the following snippet, class_to_idx has been obtained by function self._find_classes(self.root). Therefore, class_to_idx can be reused by function make_custom_dataset. Probably, file imagenet_class_to_id_map.json can be removed permanently.

    def __init__(self, root, loader, extensions=None, transform=None, target_transform=None, is_valid_file=None):
        super(CustomDatasetFolder, self).__init__(root)
        self.transform = transform
        self.target_transform = target_transform
        classes, class_to_idx = self._find_classes(self.root)
        samples = make_custom_dataset(self.root, 'imagenet_test_image_ids.txt',
                                      class_to_idx)

@CNOCycle
Copy link
Contributor Author

Any progress on this MR? If MR from external user is not allowable, I will close this MR and apply the patch on my forked repo.

@fra31 fra31 merged commit 4666028 into RobustBench:master Apr 21, 2022
@fra31
Copy link
Member

fra31 commented Apr 21, 2022

Hi,

sorry for the late reply. Thanks for the contribution, it looks good to us!

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.

2 participants