A simple, fast, and efficient object detector without FPN

Related tags

Deep Learning YOLOF
Overview

You Only Look One-level Feature (YOLOF), CVPR2021

A simple, fast, and efficient object detector without FPN.

You Only Look One-level Feature,
Qiang Chen, Yingming Wang, Tong Yang, Xiangyu Zhang, Jian Cheng, Jian Sun

image

Getting Started

  • Install cvpods
    cd YOLOF/
    python setup.py develop
  • Install mish-cuda to speed up the training and inference when using CSPDarkNet-53 as the backbone (optional)
    git clone https://github.com/thomasbrandon/mish-cuda
    cd mish-cuda
    python setup.py build install
    cd ..
  • Download the pretrained model in OneDrive or in the Baidu Cloud with code qr6o to train with the CSPDarkNet-53 backbone (optional)
    mkdir pretrained_models
    # download the `cspdarknet53.pth` to the `pretrained_models` directory
  • Train
    cd playground/detection/coco/yolof/yolof.res50.C5.1x
    pods_train --num-gpus 8
  • Test
    cd playground/detection/coco/yolof/yolof.res50.C5.1x
    pods_test --num-gpus 8 MODEL.WEIGHTS /path/to/checkpoint_file

Main results

The models listed below can be found in this onedrive link or in the BaiduCloud link with code qr6o. The FPS is tested on a 2080Ti GPU. More models will be available in the near future.

Model COCO val mAP FPS
YOLOF_R_50_C5_1x 37.7 32
YOLOF_R_50_DC5_1x 39.2 20
YOLOF_R_101_C5_1x 39.8 21
YOLOF_R_101_DC5_1x 40.5 15
YOLOF_X_101_64x4d_C5_1x 42.2 10
YOLOF_CSP_D_53_DC5_3x 41.2 39
YOLOF_CSP_D_53_DC5_9x 42.8 39
YOLOF_CSP_D_53_DC5_9x_stage2_3x 43.2 39

Citation

If you find this project useful for your research, please use the following BibTeX entry.

@inproceedings{chen2021you,
  title={You Only Look One-level Feature},
  author={Chen, Qiang and Wang, Yingming and Yang, Tong and Zhang, Xiangyu and Cheng, Jian and Sun, Jian},
  booktitle={IEEE Conference on Computer Vision and Pattern Recognition},
  year={2021}
}
Comments
  • 'no mudule named ''config'

    'no mudule named ''config'

    Hi! I have questions to disturb you. When trying to run train_net.py, I have no way to solve 'from config import config'.when the error exists'no mudule named ''config',I try to 'pip install config'.But there are still errors.I have searched for some way,but no way works.Can you help me ?

    opened by qijindao 18
  • problem

    problem

    Hi, author, I have the following problems in running your model

    Traceback (most recent call last): File "/DATA/xiexu/yolo/cvpods/tools/train_net.py", line 109, in args=(args,), File "/home/xiexu/.local/lib/python3.7/site-packages/cvpods/engine/launch.py", line 56, in launch main_func(*args) File "/DATA/xiexu/yolo/cvpods/tools/train_net.py", line 74, in main runner = runner_decrator(RUNNERS.get(cfg.TRAINER.NAME))(cfg, build_model) File "/home/xiexu/.local/lib/python3.7/site-packages/cvpods/engine/runner.py", line 86, in init self.data_loader = self.build_train_loader(cfg) File "/home/xiexu/.local/lib/python3.7/site-packages/cvpods/engine/runner.py", line 307, in build_train_loader return build_train_loader(cfg) File "/home/xiexu/.local/lib/python3.7/site-packages/cvpods/data/build.py", line 130, in build_train_loader transform_gens = build_transform_gens(cfg.INPUT.AUG.TRAIN_PIPELINES) File "/home/xiexu/.local/lib/python3.7/site-packages/cvpods/data/build.py", line 69, in build_transform_gens return build(pipelines) File "/home/xiexu/.local/lib/python3.7/site-packages/cvpods/data/build.py", line 58, in build tfm = TRANSFORMS.get(aug)(**args) File "/home/xiexu/.local/lib/python3.7/site-packages/cvpods/utils/registry.py", line 66, in get "No object named '{}' found in '{}' registry!".format(name, self._name) KeyError: "No object named 'RandomShift' found in 'transforms' registry!"

    opened by xiexu0210 13
  • python3: can't open file '/tmp/pip-req-build-6jhijoew/tools/train_net.py

    python3: can't open file '/tmp/pip-req-build-6jhijoew/tools/train_net.py

    I follow the instructions and install dependencies, cd /YOLOF/playground/detection/coco/yolof/yolof.res50.C5.1x But when I input: pods_train --num-gpus 2 I get a problem: python3: can't open file '/tmp/pip-req-build-6jhijoew/tools/train_net.py': [Errno 2] No such file or directory this what happen?

    opened by 2019ZSS 8
  • Cannot get the AP result in the paper

    Cannot get the AP result in the paper

    Hello! I'm trying to re-train this YOLOF in a single 3090 GPU with the batchsize of 32. However, even though I tried to modify some of the parameters like base-lr, steps and something else, the best AP I can get is 35.7688, which is much worse than the AP of 37.7 in your paper. Do you have any suggestions about how to modify base-learning rate, steps and warmup settings? Thank you!

    opened by yqjiang6 6
  • paper related problem

    paper related problem

    Hi! I really appreciate the authors for doing such an inspiring job and sharing the code.

    Somehow, I am kind of confused by the Sec. 4.1 of the paper. In my understanding, comparing MiMo, SiSo using C5 may cause some problems in detecting small object (High level feature with low resolution is preferred for large scale objects). To bridge the gap between SiSo and MiMo, why should we focus on larger objects? Fig 4 discusses about receptive fields. However, receptive fields of low level feature is smaller than C5, if SiSo has the receptive field problem, MiMo should have too!

    So, I don't really understand this part. I will be glad if you point me out the problem.

    Thanks in advance.

    opened by yypurpose 4
  • How do you implement the single in multiple out experiments?

    How do you implement the single in multiple out experiments?

    Hi. In your paper, Fig 1 shows SiMo style can get competitively good results, but I am wondering about the detailed architecture during experiments. How do you generate multiple outputs with a single input? Do you pick up outputs from the deeper layers to make predictions like how SSD has done?

    opened by freshn 2
  • Weight Initialization method in DilatedEncoder

    Weight Initialization method in DilatedEncoder

    https://github.com/megvii-model/YOLOF/blob/6189487b80601dfeda89302c22abac060f977785/playground/detection/coco/yolof/yolof_base/encoder.py#L64-L78

    Why the weight initialization method for lateral_conv and fpn_conv is different from the weight initialization method for conv layer in dilated_encoder_blocks?

    opened by developer0hye 2
  • How to use pretraining weights for training?

    How to use pretraining weights for training?

    How to use pretraining weights for training? After downloading the pretraining weight, which folder should I put it in? How to call the pretraining weight file?

    Thanks!

    opened by Huzhen757 2
  • cannot import name '_C' from 'cvpods'

    cannot import name '_C' from 'cvpods'

    Hello, I'm debugging the train under the tools folder 'train_net.py'.But in the cvpods folder, on line 11 of the deform_conv script : from cvpods import C. report an error here: cannot import name ' C 'from' cvpods'

    Why is this? Do I need to install any plug-ins? Thanks!

    opened by Huzhen757 2
  • KeyError:

    KeyError: "No object named 'JitterCrop' found in 'transforms' registry!"

    Env:

    1. OS version:CentOS 7
    2. Environment version: Python 3.6.13 / PyTorch 1.8.0 / CUDA 11.0 / cuDNN version
    3. cvpods version:commit id : 82374a1fe5c83e16bdd4d07adae2545d51138ef8_

    I ran the following command:

    
    cd playground/detection/coco/yolof/yolof.cspdarknet53.DC5.3x
    pods_train --num-gpus 8
    
    

    Actual results:

    
    Traceback (most recent call last):
      File "/ssd/serser/cvpods/tools/train_net.py", line 109, in <module>
        args=(args,),
      File "/ssd/serser/cvpods/cvpods/engine/launch.py", line 53, in launch
        daemon=False,
      File "/ssd/serser/venv/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 230, in spawn
        return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
      File "/ssd/serser/venv/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 188, in start_processes
        while not context.join():
      File "/ssd/serser/venv/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 150, in join
        raise ProcessRaisedException(msg, error_index, failed_process.pid)
    torch.multiprocessing.spawn.ProcessRaisedException: 
    
    -- Process 0 terminated with the following error:
    Traceback (most recent call last):
      File "/ssd/serser/venv/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 59, in _wrap
        fn(i, *args)
      File "/ssd/serser/cvpods/cvpods/engine/launch.py", line 88, in _distributed_worker
        main_func(*args)
      File "/ssd/serser/cvpods/tools/train_net.py", line 74, in main
        runner = runner_decrator(RUNNERS.get(cfg.TRAINER.NAME))(cfg, build_model)
      File "/ssd/serser/cvpods/cvpods/engine/runner.py", line 86, in __init__
        self.data_loader = self.build_train_loader(cfg)
      File "/ssd/serser/cvpods/cvpods/engine/runner.py", line 307, in build_train_loader
        return build_train_loader(cfg)
      File "/ssd/serser/cvpods/cvpods/data/build.py", line 130, in build_train_loader
        transform_gens = build_transform_gens(cfg.INPUT.AUG.TRAIN_PIPELINES)
      File "/ssd/serser/cvpods/cvpods/data/build.py", line 69, in build_transform_gens
        return build(pipelines)
      File "/ssd/serser/cvpods/cvpods/data/build.py", line 58, in build
        tfm = TRANSFORMS.get(aug)(**args)
      File "/ssd/serser/cvpods/cvpods/utils/registry.py", line 66, in get
        "No object named '{}' found in '{}' registry!".format(name, self._name)
    KeyError: "No object named 'JitterCrop' found in 'transforms' registry!"
    
    
    opened by serser 2
  • Question about ignore threshold?

    Question about ignore threshold?

    The paper points out the importance of balance matching of label assign, but actually in the code you ignores the anchor(pred) whose iou>NEG_IGNORE_THRESHOLD or < POS_IGNORE_THRESHOLD, which may break the balance?

    Also, it seems you ignore the anchor(pred) whose iou > NEG_IGNORE_THRESHOLD only make sense with max-iou label assign, why you use the the anchor(pred) whose iou is maxium or between NEG_IGNORE_THRESHOLD and NEG_IGNORE_THRESHOLD ?

    https://github.com/megvii-model/YOLOF/blob/86288132be25f0fc54d3c4b35c97a774222c12fc/playground/detection/coco/yolof/yolof_base/yolof.py#L186-L231

    opened by LMerCy 2
  • Can't download model

    Can't download model

    Hello,

    You're listing the models on onedrive and baidu. Sadly the link on onedrive is dead and I can't create a baidu account in the US. Can you reupload the models please ?

    opened by lartiguebe 0
  • Question about loss function

    Question about loss function

    In the class loss, you use the sigmoid focal loss with the binary cross-entropy loss, why not choose the softmax focal loss? And what may be the reason why the multi-classes loss doesn't converge?

    opened by Ivanyan0516 0
  • uniform matching how to choose k nearest anchors

    uniform matching how to choose k nearest anchors

    dear author:
    your paper writes "Adopting the K nearest anchor as positive anchors for each ground-truth box", but when reading your code, I saw that you selected K nearest positive samples from pred boxes and anchors respectively. In fact, the number of positive samples corresponding to each GT box is 2k. Is this a later improvement? we also attention that uniform matching ignore the positive samples which IoU<0.15.does this will cause some very small targets have none positive samples?

    opened by qyu21490 0
  • there are some errors when I run pods_train

    there are some errors when I run pods_train

    Dear author, when I try to run 'pods_train --num-gpus 1', There are some errors:

    ImportError: /home/dl/deep/aqyu/YOLOF/cvpods/_C.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZN6cvpods26psroi_pooling_forward_cudaERN2at6TensorES2_S2_iifii

    opened by qyu21490 1
  • pods_train: command not found

    pods_train: command not found

    hi, I follow the installation instruction, and everything is ok until comes to "Train" part. After cd into playground/detection/coco/yolof/yolof.res50.C5.1x, I run the shell script pods_train --num_gpus 1, and get pods_train: command not found

    looking forward to your reply, thanks

    opened by WuChannn 5
Owner
null
Pytorch implementation of Feature Pyramid Network (FPN) for Object Detection

fpn.pytorch Pytorch implementation of Feature Pyramid Network (FPN) for Object Detection Introduction This project inherits the property of our pytorc

Jianwei Yang 912 Dec 21, 2022
Deformable DETR is an efficient and fast-converging end-to-end object detector.

Deformable DETR: Deformable Transformers for End-to-End Object Detection.

null 2k Jan 5, 2023
Lane follower: Lane-detector (OpenCV) + Object-detector (YOLO5) + CAN-bus

Lane Follower This code is for the lane follower, including perception and control, as shown below. Environment Hardware Industrial Camera Intel-NUC(1

Siqi Fan 3 Jul 7, 2022
LiDAR R-CNN: An Efficient and Universal 3D Object Detector

LiDAR R-CNN: An Efficient and Universal 3D Object Detector Introduction This is the official code of LiDAR R-CNN: An Efficient and Universal 3D Object

TuSimple 295 Jan 5, 2023
ViDT: An Efficient and Effective Fully Transformer-based Object Detector

ViDT: An Efficient and Effective Fully Transformer-based Object Detector by Hwanjun Song1, Deqing Sun2, Sanghyuk Chun1, Varun Jampani2, Dongyoon Han1,

NAVER AI 262 Dec 27, 2022
HeartRate detector with ArduinoandPython - Use Arduino and Python create a heartrate detector.

Syllabus of Contents Syllabus of Contents Introduction Of Project Features Develop With Python code introduction Installation License Developer Contac

null 1 Jan 5, 2022
Video lie detector using xgboost - A video lie detector using OpenFace and xgboost

video_lie_detector_using_xgboost a video lie detector using OpenFace and xgboost

null 2 Jan 11, 2022
A whale detector design for the Kaggle whale-detector challenge!

CNN (InceptionV1) + STFT based Whale Detection Algorithm So, this repository is my PyTorch solution for the Kaggle whale-detection challenge. The obje

Tarin Ziyaee 92 Sep 28, 2021
Imposter-detector-2022 - HackED 2022 Team 3IQ - 2022 Imposter Detector

HackED 2022 Team 3IQ - 2022 Imposter Detector By Aneeljyot Alagh, Curtis Kan, Jo

Joshua Ji 3 Aug 20, 2022
Playing around with FastAPI and streamlit to create a YoloV5 object detector

FastAPI-Streamlit-based-YoloV5-detector Playing around with FastAPI and streamlit to create a YoloV5 object detector It turns out that a User Interfac

null 2 Jan 20, 2022
Official code of the paper "ReDet: A Rotation-equivariant Detector for Aerial Object Detection" (CVPR 2021)

ReDet: A Rotation-equivariant Detector for Aerial Object Detection ReDet: A Rotation-equivariant Detector for Aerial Object Detection (CVPR2021), Jiam

csuhan 334 Dec 23, 2022
Official Implementation of DDOD (Disentangle your Dense Object Detector), ACM MM2021

Disentangle Your Dense Object Detector This repo contains the supported code and configuration files to reproduce object detection results of Disentan

loveSnowBest 51 Jan 7, 2023
Morphable Detector for Object Detection on Demand

Morphable Detector for Object Detection on Demand (ICCV 2021) PyTorch implementation of the paper Morphable Detector for Object Detection on Demand. I

null 9 Feb 23, 2022
Train a state-of-the-art yolov3 object detector from scratch!

TrainYourOwnYOLO: Building a Custom Object Detector from Scratch This repo let's you train a custom image detector using the state-of-the-art YOLOv3 c

AntonMu 616 Jan 8, 2023
Code for "The Box Size Confidence Bias Harms Your Object Detector"

The Box Size Confidence Bias Harms Your Object Detector - Code Disclaimer: This repository is for research purposes only. It is designed to maintain r

Johannes G. 24 Dec 7, 2022
Embracing Single Stride 3D Object Detector with Sparse Transformer

SST: Single-stride Sparse Transformer This is the official implementation of paper: Embracing Single Stride 3D Object Detector with Sparse Transformer

TuSimple 385 Dec 28, 2022
A Pytorch Implementation of [Source data‐free domain adaptation of object detector through domain

A Pytorch Implementation of Source data‐free domain adaptation of object detector through domain‐specific perturbation Please follow Faster R-CNN and

null 1 Dec 25, 2021
A Pytorch Implementation of Domain adaptation of object detector using scissor-like networks

A Pytorch Implementation of Domain adaptation of object detector using scissor-like networks Please follow Faster R-CNN and DAF to complete the enviro

null 2 Oct 7, 2022
BigDetection: A Large-scale Benchmark for Improved Object Detector Pre-training

BigDetection: A Large-scale Benchmark for Improved Object Detector Pre-training By Likun Cai, Zhi Zhang, Yi Zhu, Li Zhang, Mu Li, Xiangyang Xue. This

null 290 Dec 29, 2022