This is a Office implementation of the Refining and reweighting pseudo labels for weakly supervised object ScienceDirect.
a. Create a conda virtual environment and activate it.
conda create -n wsod python=3.7 -y
conda activate wsod
b. Install other packets as followings.
- numpy 1.21.6
- opecv-python 4.7.0.72
- torch 1.6.0
- torchvision 0.7.0
- tensorboard 2.11.2
sh train.sh
Note that For VOC2007 and VOC2012, please use vgg16_voc2007_more.yaml and vgg16_voc2012.yaml respectively. Regarding the main configurations of the attention module and label optimization part, please note the CDBLOCK field and SUP field in the configuration files.
sh train_fast_rcnn.sh
Note that The configuration files used in this part are vgg16_voc2007_fast.yaml and vgg16_voc2012_fast.yaml. The main codes for dynamic partitioning and weight adjustment are located in lib/core/loss_helper.py, and the specific parameter configurations can refer to the paper.
sh test.sh
sh test_fast.sh
Note that when using the trainval dataset as the test set, the corloc localization accuracy metric is used by default, and when using the test dataset as the test set, mAP50 is used as the evaluation metric.