All Projects → ZHANGHeng19931123 → MutualGuide

ZHANGHeng19931123 / MutualGuide

Licence: MIT license
Localize to Classify and Classify to Localize: Mutual Guidance in Object Detection

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to MutualGuide

awesome-efficient-gnn
Code and resources on scalable and efficient Graph Neural Networks
Stars: ✭ 498 (+413.4%)
Mutual labels:  knowledge-distillation
torch-model-compression
针对pytorch模型的自动化模型结构分析和修改工具集,包含自动分析模型结构的模型压缩算法库
Stars: ✭ 126 (+29.9%)
Mutual labels:  tensorrt
InsightFace-REST
InsightFace REST API for easy deployment of face recognition services with TensorRT in Docker.
Stars: ✭ 308 (+217.53%)
Mutual labels:  tensorrt
LabelRelaxation-CVPR21
Official PyTorch Implementation of Embedding Transfer with Label Relaxation for Improved Metric Learning, CVPR 2021
Stars: ✭ 37 (-61.86%)
Mutual labels:  knowledge-distillation
MLIC-KD-WSD
Multi-Label Image Classification via Knowledge Distillation from Weakly-Supervised Detection (ACM MM 2018)
Stars: ✭ 58 (-40.21%)
Mutual labels:  knowledge-distillation
ros-yolo-sort
YOLO v3, v4, v5, v6, v7 + SORT tracking + ROS platform. Supporting: YOLO with Darknet, OpenCV(DNN), OpenVINO, TensorRT(tkDNN). SORT supports python(original) and C++. (Not Deep SORT)
Stars: ✭ 162 (+67.01%)
Mutual labels:  tensorrt
BAKE
Self-distillation with Batch Knowledge Ensembling Improves ImageNet Classification
Stars: ✭ 79 (-18.56%)
Mutual labels:  knowledge-distillation
self-driving-ish computer vision system
This project generates images you've probably seen in autonomous driving demo. Object Detection, Lane Detection, Road Segmentation, Depth Estimation using TensorRT
Stars: ✭ 254 (+161.86%)
Mutual labels:  tensorrt
LD
Localization Distillation for Dense Object Detection (CVPR 2022)
Stars: ✭ 271 (+179.38%)
Mutual labels:  knowledge-distillation
yolov4 trt ros
YOLOv4 object detector using TensorRT engine
Stars: ✭ 89 (-8.25%)
Mutual labels:  tensorrt
tensorrt-ssd-easy
No description or website provided.
Stars: ✭ 32 (-67.01%)
Mutual labels:  tensorrt
Distill-BERT-Textgen
Research code for ACL 2020 paper: "Distilling Knowledge Learned in BERT for Text Generation".
Stars: ✭ 121 (+24.74%)
Mutual labels:  knowledge-distillation
mediapipe plus
The purpose of this project is to apply mediapipe to more AI chips.
Stars: ✭ 38 (-60.82%)
Mutual labels:  tensorrt
yolov5 tensorrt
This is the implementation that supports yolov5s, yolov5m, yolov5l, yolov5x.
Stars: ✭ 32 (-67.01%)
Mutual labels:  tensorrt
yolov5 tensorrt int8
TensorRT int8 量化部署 yolov5s 模型,实测3.3ms一帧!
Stars: ✭ 112 (+15.46%)
Mutual labels:  tensorrt
EfficientNetv2 TensorRT int8
EfficientNetv2 TensorRT int8
Stars: ✭ 34 (-64.95%)
Mutual labels:  tensorrt
SAN
[ECCV 2020] Scale Adaptive Network: Learning to Learn Parameterized Classification Networks for Scalable Input Images
Stars: ✭ 41 (-57.73%)
Mutual labels:  knowledge-distillation
mtomo
Multiple types of NN model optimization environments. It is possible to directly access the host PC GUI and the camera to verify the operation. Intel iHD GPU (iGPU) support. NVIDIA GPU (dGPU) support.
Stars: ✭ 24 (-75.26%)
Mutual labels:  tensorrt
pnn
pnn is Darknet compatible neural nets inference engine implemented in Rust.
Stars: ✭ 17 (-82.47%)
Mutual labels:  tensorrt
neural-compressor
Intel® Neural Compressor (formerly known as Intel® Low Precision Optimization Tool), targeting to provide unified APIs for network compression technologies, such as low precision quantization, sparsity, pruning, knowledge distillation, across different deep learning frameworks to pursue optimal inference performance.
Stars: ✭ 666 (+586.6%)
Mutual labels:  knowledge-distillation

Introduction

MutualGuide is a compact object detector specially designed for edge computing devices. Comparing to existing detectors, this repo contains two key features.

Firstly, the Mutual Guidance mecanism assigns labels to the classification task based on the prediction on the localization task, and vice versa, alleviating the misalignment problem between both tasks; Secondly, the teacher-student prediction disagreements guides the knowledge transfer in a feature-based detection distillation framework, thereby reducing the performance gap between both models.

For more details, please refer to our ACCV paper and BMVC paper.

Planning

  • Train medium and large models.
  • Add SIOU loss.
  • Add CspDarknet backbone.
  • Add RepVGG backbone.
  • Add ShuffleNetV2 backbone.
  • Add SwinTransformer backbone.
  • Add TensorRT transform code for inference acceleration.
  • Add vis function to plot detection results.
  • Add custom dataset training (annotations in XML format).

Benchmark

Backbone Size APval
0.5:0.95
APval
0.5
APval
0.75
APval
small
APval
medium
APval
large
Params
(M)
FLOPs
(G)
Speed
(ms)
cspdarknet-0.75 640x640 43.0 61.1 46.2 24.2 50.0 59.9 24.32 24.02 11.4(3060)
cspdarknet-0.5 640x640 40.4 58.4 43.3 21.0 46.4 58.0 17.40 12.67 6.5(3060)
resnet18 640x640 40.4 58.5 43.3 19.9 46.5 58.9 22.09 22.95 8.5(3060)
repvgg-A0 640x640 39.9 58.2 42.5 20.3 46.1 57.9 12.30 18.40 7.5(3060)
shufflenet-1.5 640x640 35.7 53.9 37.9 16.5 41.3 53.5 2.55 2.65 5.6(3060)
shufflenet-1.0 640x640 31.8 49.0 33.1 13.6 35.8 48.4 1.50 1.47 5.4(3060)

Remarks:

  • The precision is measured on the COCO2017 Val dataset.
  • The inference runtime is measured by Pytorch framework (without TensorRT acceleration) on a GTX 3060 GPU, and the post-processing time (e.g., NMS) is not included (i.e., we measure the model inference time).
  • To dowload from Baidu cloud, go to this link (password: mugu).

Datasets

First download the COCO2017 dataset, you may find the sripts in data/scripts/ helpful. Then modify the parameter self.root in data/coco.py to the path of COCO dataset:

self.root = os.path.join("/home/heng/Documents/Datasets/", "COCO/")

Remarks:

  • For training on custom dataset, first modify the dataset path and categories XML_CLASSES in data/xml_dataset.py. Then apply --dataset XML.

Training

For training with Mutual Guide:

$ python3 train.py --neck ssd --backbone vgg16    --dataset COCO
                          fpn            resnet34           VOC
                          pafpn          repvgg-A2          XML
                                         cspdarknet-0.75
                                         shufflenet-1.0
                                         swin-T

For knowledge distillation using PDF-Distil:

$ python3 distil.py --neck ssd --backbone vgg11    --dataset COCO  --kd pdf
                           fpn            resnet18           VOC
                           pafpn          repvgg-A1          XML
                                          cspdarknet-0.5
                                          shufflenet-0.5

Remarks:

  • For training without MutualGuide, just use the --mutual_guide False;
  • For training on custom dataset, convert your annotations into XML format and use the parameter --dataset XML. An example is given in datasets/XML/;
  • For knowledge distillation with traditional MSE loss, just use parameter --kd mse;
  • The default folder to save trained model is weights/.

Evaluation

Every time you want to evaluate a trained network:

$ python3 test.py --neck ssd --backbone vgg11    --dataset COCO --trained_model path_to_saved_weights --vis
                         fpn            resnet18           VOC
                         pafpn          repvgg-A1          XML
                                        cspdarknet-0.5
                                        shufflenet-0.5

Remarks:

  • It will directly print the mAP, AP50 and AP50 results on COCO2017 Val;
  • Add parameter --vis to draw detection results. They will be saved in vis/VOC/ or vis/COCO/ or vis/XML/;

Citing us

Please cite our papers in your publications if they help your research:

@InProceedings{Zhang_2020_ACCV,
    author    = {Zhang, Heng and Fromont, Elisa and Lefevre, Sebastien and Avignon, Bruno},
    title     = {Localize to Classify and Classify to Localize: Mutual Guidance in Object Detection},
    booktitle = {Proceedings of the Asian Conference on Computer Vision (ACCV)},
    month     = {November},
    year      = {2020}
}

@InProceedings{Zhang_2021_BMVC,
    author    = {Zhang, Heng and Fromont, Elisa and Lefevre, Sebastien and Avignon, Bruno},
    title     = {PDF-Distil: including Prediction Disagreements in Feature-based Distillation for object detection},
    booktitle = {Proceedings of the British Machine Vision Conference (BMVC)},
    month     = {November},
    year      = {2021}
}

Acknowledgement

This project contains pieces of code from the following projects: ssd.pytorch, rfbnet, mmdetection and yolox.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].