zh460045050 / DA-WSOL_CVPR2022

Official implementation of the paper ``Weakly Supervised Object Localization as Domain Adaption"
49 stars 9 forks source link

How to train with custom dataset? #3

Open harrytrinh96 opened 2 years ago

harrytrinh96 commented 2 years ago

How to train with custom dataset?

harrytrinh96 commented 2 years ago

@zh460045050 please help

zh460045050 commented 2 years ago

Firstly, you may prepare the custom dataset with similar layout as our "CUB/OpenImage/ILSVRC dataset". Then you should prepare your "images_id.txt" and "class_labels.txt" that contain the path and class label of training images (following these two file for CUB-200 dataset provided in our google drive), and put them into metadata/your_dataset_name/train/". If you have validation set with localization labels, you should also prepare thelocalization.txt" that contains bounding boxes annotations (x1,y1,x2,y2) (or the path of the localization mask), and put localization.txt & images_id.txt & class_labels.txt" of your validation images intometadata/your_dataset_name/val/". Finally, adding ``your_dataset_name" in _DATASET_NAMES parameter (in config.py), setting the number of object classes in _NUM_CLASSES_MAPPING parameter (in solver.py), and selecting the type of validation (mask/bbox) in CAMComputer function (in inference.py) for your dataset.