This is an official implementation for "Boosting Semi-Supervised Object Detection in Remote Sensing Images with Active Teaching".
The overall framework of our SSOD-AT.
-
Install detectron2 following the instructions.
-
Install SSOD-AT via pip:
python3 -m pip install -e .
- Download DOTA-v1.0 and DIOR
- Following
tools/prepare_dota_1024.py
to convert them to COCO format - Divide DOTA and DIOR into 2:1 for training and testing, respectively.
dota/
annotations/
train.json
train/
images/
test/
images/
Use Custom Datasets gives a deeper dive on how to use DatasetCatalog
and MetadataCatalog
, and how to add new datasets to them.
python ./tools/generate_random_data_partition.py \
--random-file ./dataseed/random_dota/dota_supervision_5.0.txt \
--random-percent 5.0 \
--datasets dota_1024_coco_train,
mkdir temp
mkdir temp/dota
mkdir results
mkdir results/dota
mkdir dataseed/dota_pick
python tools/train_net.py \
--num-gpus 2 \
--config configs/dota_coco_1024/dota_coco_1024_sup5_run1.yaml \
OUTPUT_DIR output/dota_1/dota_1024_sup5_run1_32bs DATALOADER.RANDOM_DATA_SEED_PATH dataseed/random_dota/dota_supervision_5.0.txt
python tools/inference_for_active_pick.py \
--static-file temp/dota/static_by_random5.json \
--model-weights output/dota/dota_1024_sup5_run1_32bs/model_best.pth \
--config configs/dota_coco_1024/dota_coco_1024_sup5_run1.yaml
python tools/active_pick_evaluation.py \
--static-file temp/dota/static_by_random5.json \
--indicator-file results/dota/5random_0active
python tools/generate_pick_merge_random_data_partition.py \
--random-file dataseed/random_dota/dota_supervision_5.0.txt \
--random-percent 5.0 \
--indicator-file results/dota/5random_0active.txt \
--pick-percent 5.0 \
--reverse True \
--save-file dataseed/dota_pick/active5+random5.txt
python tools/train_net.py \
--num-gpus 2 \
--config configs/dota_coco_1024/dota_coco_1024_sup10_run1.yaml \
SOLVER.IMG_PER_BATCH_LABEL 16 SOLVER.IMG_PER_BATCH_UNLABEL 16 OUTPUT_DIR output/dota/dota_1024_sup10_run1 DATALOADER.RANDOM_DATA_SEED_PATH dataseed/dota_pick/active5+random5.txt MODEL.WEIGHTS output/dota/dota_1024_sup5_run1_32bs/model_best.pth
Test 20% labeled DOTA for exemple
python tools/train_net.py \
--eval-only \
--num-gpus 2 \
--config configs/dota_coco_1024/dota_coco_1024_sup20_run1.yaml \
SOLVER.IMG_PER_BATCH_LABEL 16 SOLVER.IMG_PER_BATCH_UNLABEL 16 MODEL.WEIGHTS output/dota/dota_1024_sup20_run1_32bs/model_final.pth
- The results figures on DOTA and DIOR are shown as below:
You will be able to cite this work after the paper is accepted.
SSOD-AT is released under the Apache 2.0 license.