Code Monkey home page Code Monkey logo

detr-lab's Introduction

DeTR-LAB

Library of Detection with Transformer

Requirements

  • We recommend you to use Anaconda to create a conda environment:
conda create -n detr python=3.6
  • Then, activate the environment:
conda activate detr
  • Requirements:
pip install -r requirements.txt 

We suggest that PyTorch should be higher than 1.9.0 and Torchvision should be higher than 0.10.3. At least, please make sure your torch is version 1.x.

This repository

In this repository, you can enjoy:

  • DETR
  • Anchor-DETR
  • DINO

Experiments

DETR

I evaluate DETR by loading official pretrained weight.

Model backbone FPS
3090
FLOPs Params AP Weight
DETR-R50 R-50 37 95.2 B 36.7 M 41.7 github
DETR-R50-DC5 R-50 20 162.1 B 36.7 M 43.0 github
DETR-R101 R-101 25 174.7 B 55.7 M 43.1 github
DETR-R101-DC5 R-101 14 241.6 B 55.7 M 44.3 github

Anchor DETR

I evaluate AnchorDETR by loading official pretrained weight.

Model backbone FPS
3090
FLOPs Params AP Weight
Anchor-DETR-R50 R-50 37 97.0 B 30.7 M 42.1 github
Anchor-DETR-R50-DC5 R-50 20 154.0 B 30.7 M 44.2 github
Anchor-DETR-R101 R-101 21 176.5 B 49.7 M 43.5 github
Anchor-DETR-R101-DC5 R-101 16 233.5 B 49.7 M 45.2 github

Train

sh train.sh

You can change the configurations of train.sh, according to your own situation.

However, limited by my GPU, I can't verify whether this repository can reproduce the performance of the official DETR.

Test

python test.py -d coco \
               --cuda \
               -v detr_r50 \
               --weight path/to/weight \
               --root path/to/dataset/ \
               --show

Evaluation

python eval.py -d coco-val \
               --cuda \
               -v detr_r50 \
               --weight path/to/weight \
               --root path/to/dataset/

Demo

I have provide some images in data/demo/images/, so you can run following command to run a demo:

python demo.py --mode image \
               --path_to_img dataset/demo/images/ \
               -v detr_r50 \
               --cuda \
               --weight path/to/weight \
               --show

If you want run a demo of streaming video detection, you need to set --mode to video, and give the path to video --path_to_vidใ€‚

python demo.py --mode video \
               --path_to_img dataset/demo/videos/video_name \
               -v detr_r50 \
               --cuda \
               --weight path/to/weight \
               --show

If you want run video detection with your camera, you need to set --mode to cameraใ€‚

python demo.py --mode camera \
               -v detr_r50 \
               --cuda \
               --weight path/to/weight \
               --show

detr-lab's People

Contributors

yjh0410 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.