Robust Teacher : Self-Correcting Pseudo-Labels Guided Robust Semi-Supervised Learning for Object Detection
- Linux or macOS with Python ≥ 3.6
- PyTorch ≥ 1.5 and torchvision that matches the PyTorch installation.
# create conda env
conda create -n detectron2 python=3.6
# activate the enviorment
conda activate detectron2
# install PyTorch >=1.5 with GPU
conda install pytorch torchvision -c pytorch
git clone https://github.com/Complicateddd/RobustT.git
Follow the INSTALL.md to install Detectron2.
Note: Follow our specific detectron2 components with README.md to modify base detection framework.
- Download COCO dataset
# download images
wget http://images.cocodataset.org/zips/train2017.zip
wget http://images.cocodataset.org/zips/val2017.zip
# download annotations
wget http://images.cocodataset.org/annotations/annotations_trainval2017.zip
- Download Pascal VOC dataset from VOC challenges website.
- Update your project dataset position in 'detectron2/data/datasets/builtin.py'
- We provide the whole dataset necessary info file, you can download them from VOC_COCO_info, password: l2h5
- Train the Robust Teacher under 10% COCO-supervision
python train_net.py \
--num-gpus 2 \
--config configs/coco_supervision/faster_rcnn_R_50_FPN_sup10_run1_weak.yaml \
SOLVER.IMG_PER_BATCH_LABEL 4 SOLVER.IMG_PER_BATCH_UNLABEL 4 \
OUTPUT_DIR ./output10COCO
- Train the Robust Teacher under VOC07 (as labeled set) and VOC12 (as unlabeled set)
python train_net.py \
--num-gpus 2 \
--config configs/voc/weak_super_voc07_voc12.yaml \
SOLVER.IMG_PER_BATCH_LABEL 4 SOLVER.IMG_PER_BATCH_UNLABEL 4
OUTPUT_DIR ./outputvoc0712
- Train the Robust Teacher under VOC07 (as labeled set) and VOC12+COCO20cls (as unlabeled set)
python train_net.py \
--num-gpus 2 \
--config configs/voc/weak_super_voc07_voc12coco20.yaml \
SOLVER.IMG_PER_BATCH_LABEL 4 SOLVER.IMG_PER_BATCH_UNLABEL 4 \
OUTPUT_DIR ./outputvoc0712cococls
python train_net.py \
--resume \
--num-gpus 2 \
--config configs/coco_supervision/faster_rcnn_R_50_FPN_sup10_run1_weak.yaml \
SOLVER.IMG_PER_BATCH_LABEL 16 SOLVER.IMG_PER_BATCH_UNLABEL 16 \
MODEL.WEIGHTS <your weight>.pth
python train_net.py \
--eval-only \
--num-gpus 2 \
--config configs/coco_supervision/faster_rcnn_R_50_FPN_sup10_run1_weak.yaml \
SOLVER.IMG_PER_BATCH_LABEL 4 SOLVER.IMG_PER_BATCH_UNLABEL 4 \
MODEL.WEIGHTS <your weight>.pth
This repository draws on the following excellent works: