Home

Awesome

FocalNet for Object Detection with DINO

This repo contains the code for reproducing object detection results of our FocalNets. It is based on DINO.

Installation

Please follow DINO's instruction for installation.

Training

python -m torch.distributed.launch --nproc_per_node={ngpus} main.py --config_file config/DINO/DINO_4scale_focalnet_fl3.py --coco_path {coco_path} --output_dir {output_dir}
python -m torch.distributed.launch --nproc_per_node={ngpus} main.py --config_file config/DINO/DINO_5scale_focalnet_fl4.py --coco_path {coco_path} --output_dir {output_dir}

Model Zoos

FocalNet-DINO pretrained with Object365:

BackboneMethodPretrained DataCOCO minival mAP (w/o tta)Download
Swin-LDINOObject36563.1-
FocalNet-LDINOObject36563.5in21k ckpt/o365 ckpt/coco ckpt

Related Links

Thanks to the authors of DINO, the DINO models trained with FocalNets as the backbones can be found here:

FocalNet-L + DINO: DINO + FocalNet-L

All pretrained models on imagenet-1k or imagenet-21k are provided in:

Focal Modulation Networks: Focal Modulation Networks Model Zoo.

Citation

If you find this repo useful to your project, please consider to cite it with following bib:

@misc{yang2022focalnet,  
  author = {Yang, Jianwei and Li, Chunyuan and Dai, Xiyang and Yuan, Lu and Gao, Jianfeng},
  title = {Focal Modulation Networks},
  publisher = {arXiv},
  year = {2022},
}

and also:

@misc{zhang2022dino,
      title={DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection}, 
      author={Hao Zhang and Feng Li and Shilong Liu and Lei Zhang and Hang Su and Jun Zhu and Lionel M. Ni and Heung-Yeung Shum},
      year={2022},
      eprint={2203.03605},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}