MCPcopy Index your code
hub / github.com/ChenhongyiYang/PGD

github.com/ChenhongyiYang/PGD @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
2,471 symbols 8,996 edges 957 files 1,430 documented · 58%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Prediction-Guided Distillation

PyTorch implementation of our ECCV 2022 paper: Prediction-Guided Distillation for Dense Object Detection

Requirements

  • Our codebase is built on top of MMDetection, which can be installed following the offcial instuctions.
  • We used pytorch pre-trained ResNets for training.
  • Please follow the MMdetection offcial instuction to set up COCO dataset.
  • Please download the CrowdHuman and set up the dataset by running this script.

Usage

Set up datasets and pre-trained models

mkdir data
ln -s path_to_coco data/coco
ln -s path_to_crowdhuman data/crowdhuman 
ln -s path_to_pretrainedModel data/pretrain_models 

COCO Experiments

# ------------------------------------
#    Here we use ATSS as an example
# ------------------------------------

# Training and testing teacher model
zsh tools/dist_train.sh work_configs/detectors/atss_r101_3x_ms.py 8
zsh tools/dist_test.sh work_configs/detectors/atss_r101_3x_ms.py work_dirs/atss_r101_3x_ms/latest.pth 8

# Training and testing student model 
zsh tools/dist_train.sh work_configs/detectors/atss_r50_1x.py 8
zsh tools/dist_test.sh work_configs/detectors/atss_r50_1x.py work_dirs/atss_r50_1x/latest.pth 8

# Training and testing PGD model
zsh tools/dist_train.sh work_configs/pgd_atss_r101_r50_1x.py 8
zsh tools/dist_test.sh work_configs/pgd_atss_r101_r50_1x.py work_dirs/pgd_atss_r101_r50_1x/latest.pth 8

CrowdHuman Experiments

# Training teacher, conducting KD, and evalauation
zsh tools/run_crowdhuman.sh

Model Zoo

COCO

Detector Setting mAP Config
FCOS Teacher (r101, 3x, multi-scale) 43.1 config
- Student (r50, 1x, single-scale) 38.2 config
- PGD (r50, 1x, single-scale) 42.5 (+4.3) config
AutoAssign Teacher (r101, 3x, multi-scale) 44.8 config
- Student (r50, 1x, single-scale) 40.6 config
- PGD (r50, 1x, single-scale) 43.8 (+3.1) config
ATSS Teacher (r101, 3x, multi-scale) 45.5 config
- Student (r50, 1x, single-scale) 39.6 config
- PGD (r50, 1x, single-scale) 44.2 (+4.6) config
GFL Teacher (r101, 3x, multi-scale) 45.8 config
- Student (r50, 1x, single-scale) 40.2 config
- PGD (r50, 1x, single-scale) 43.8 (+3.6) config
DDOD Teacher (r101, 3x, multi-scale) 46.6 config
- Student (r50, 1x, single-scale) 42.0 config
- PGD (r50, 1x, single-scale) 45.4 (+3.4) config

CrowdHuman

Detector Setting MR ↓ AP ↑ JI ↑ Config
DDOD Teacher (r101, 36 epoch, multi-scale) 41.4 90.2 81.4 config
- Student (r50, 12 epoch, single-scale) 46.0 88.0 79.0 config
- PGD (r50, 12 epoch, single-scale) 42.8 (-3.2) 90.0 (+2.0) 80.7 (+1.7) config

Ciation

@article{yang2022predictionguided,
  title={{Prediction-Guided Distillation for Dense Object Detection}},
  author={Yang, Chenhongyi and Ochal, Mateusz and Storkey, Amos and Crowley, Elliot J},
  journal={ECCV 2022},
  year={2022}
}

Acknowledgement

We thank FGD and DDOD for their code base.

Core symbols most depended-on inside this repo

to
called by 86
mmdet/core/bbox/samplers/sampling_result.py
images_to_levels
called by 79
mmdet/core/anchor/utils.py
multi_apply
called by 75
mmdet/core/utils/misc.py
unmap
called by 73
mmdet/core/utils/misc.py
build_loss
called by 68
mmdet/models/builder.py
cuda
called by 68
mmdet/models/detectors/kd_one_stage.py
decode
called by 59
mmdet/core/bbox/coder/base_bbox_coder.py
expand
called by 50
mmdet/core/mask/structures.py

Shape

Method 1,503
Function 614
Class 351
Route 3

Languages

Python100%

Modules by API surface

mmdet/datasets/pipelines/transforms.py78 symbols
mmdet/core/mask/structures.py59 symbols
mmdet/datasets/pipelines/auto_augment.py54 symbols
mmdet/core/anchor/anchor_generator.py31 symbols
tests/test_utils/test_masks.py30 symbols
mmdet/models/utils/transformer.py28 symbols
mmdet/models/dense_heads/yolact_head.py28 symbols
mmdet/datasets/pipelines/formating.py28 symbols
mmdet/datasets/pipelines/loading.py27 symbols
mmdet/models/dense_heads/cascade_rpn_head.py26 symbols
mmdet/models/backbones/resnet.py26 symbols
tests/test_utils/test_assigner.py22 symbols

For agents

$ claude mcp add PGD \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact