Official implementation of Cooperative-Students: Navigating Unsupervised Domain Adaptation in Nighttime Object Detection.
-
Python ≥ 3.6
-
PyTorch ≥ 1.5 and torchvision that matches the PyTorch installation.
-
Detectron2 == 0.6 (The version I used to run my code)
- 2 Nvidia A40 (2 * 9 batch size)
To install required dependencies on the virtual environment of the python (e.g., virtualenv for python3), please run the following command at the root of this code:
$ python3 -m venv /path/to/new/virtual/environment/.
$ source /path/to/new/virtual/environment/bin/activate
For example:
$ mkdir python_env
$ python3 -m venv python_env/
$ source python_env/bin/activate
Follow the INSTALL.md to install Detectron2.
-
Download the datasets
Dataset URL Num of Classes Daytime Nighttime (UDA) Nighttime (Eval) BDD100K Link 10 36,728 32,998 4,707 SHIFT Link 6 19,452 8,497 1,200 ACDC Link 8 1,200 400 400 -
Organize the dataset in COCO format following:
cos/
└── data/
└── bdd100k/
└── images/
├── train/
└── val/
├── train_day.json
└── train_night.json
└── val_night.json
└── shift/
└── images/
├── train/
└── val/
├── train_day.json
└── train_night.json
└── val_night.json
└── ACDC/
├── rgb_anon/
└── instancesonly_day_train_gt_detection_continue.json
└── instancesonly_night_train_gt_detection_continue.json
└── instancesonly_night_val_gt_detection_continue.json
- Train the Cooperative Students from daytime to nighttime using BDD100K
python train_net.py \
--num-gpus 2 \
--config configs/faster_rcnn_R50_BDD.yaml \
OUTPUT_DIR output/bdd100k
- Train the Cooperative Students from daytime to nighttime using SHIFT
python train_net.py \
--num-gpus 2 \
--config configs/faster_rcnn_R50_SHIFT.yaml \
OUTPUT_DIR output/shift
python train_net.py \
--resume \
--num-gpus 2 \
--config configs/faster_rcnn_R50_BDD.yaml MODEL.WEIGHTS <your weight>.pth
python train_net.py \
--eval-only \
--num-gpus 2 \
--config configs/faster_rcnn_R50_BDD.yaml \
MODEL.WEIGHTS <your weight>.pth
@article{yuan2024cooperative,
title={Cooperative Students: Navigating Unsupervised Domain Adaptation in Nighttime Object Detection},
author={Yuan, Jicheng and Le-Tuan, Anh and Hauswirth, Manfred and Le-Phuoc, Danh},
journal={arXiv preprint arXiv:2404.01988},
year={2024}
}