mmdetection icon indicating copy to clipboard operation
mmdetection copied to clipboard

[WIP]: Refactor DETR and Deformable DETR on 3.x

Open Li-Qingyun opened this issue 3 years ago • 2 comments

Motivation

We (me, @jshilong, @LYMDLUT, and @KeiChiTse) are going to refactor DETR-like models, to enhance the usability and readability of our codebase.

Li-Qingyun avatar Sep 10 '22 03:09 Li-Qingyun

Short-term Plan

We plan to implement a base detector class for Transformer-based detector, TransformerDetector, move the transformer-related part in the original head module to the new detector module, and use TransformerEncoder and TransformerDecoder directly in the detector.

NOTE we are still exploring better refactoring solutions, and the short-term plans are only tried temporarily. It is welcome to give suggestions for refactor and report bugs, in the comments or reviews, or contact me. (wechat:18545525156 or email: [email protected]).

Li-Qingyun avatar Sep 10 '22 03:09 Li-Qingyun

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 19 '22 06:09 CLAassistant

Short-term Plan

We decided to refactor the forward process of Transformer in the TransformerDetector class. Specifically, the whole forward process is wrapped with forward_Transformer, which is divided into about four parts: pre_transformer, forward_encoder, pre_decoder, forward_decoder.

NOTE we are still exploring better refactoring solutions, and the short-term plans are only tried temporarily. It is welcome to give suggestions for refactor and report bugs, in the comments or reviews, or contact me. (wechat:18545525156 or email: [email protected]).

Li-Qingyun avatar Sep 29 '22 02:09 Li-Qingyun

The overall design LGTM now, this pr may be merged after benchmarking the DETR and DeformDETR

jshilong avatar Oct 11 '22 05:10 jshilong

The design LGTM. Only need to fix minor comments +1

Thank you very much for the review and the suggestions! The comments have been fixed! @Tai-Wang

Li-Qingyun avatar Oct 12 '22 08:10 Li-Qingyun

The whole design LGTM.

RangiLyu avatar Oct 14 '22 07:10 RangiLyu

The whole design LGTM.

Thanks very much for your review and the suggestions! The comments have been replied and modifications have been committed. @RangiLyu

Li-Qingyun avatar Oct 15 '22 10:10 Li-Qingyun