GithubHelp home page GithubHelp logo

raozhongyu / tracklite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stephenfang51/tracklite

0.0 1.0 0.0 48.76 MB

Using Tensort to speed up yolov3 with deepsort for MOT

Python 95.30% Shell 0.03% C++ 1.92% C 0.13% Cuda 2.62%

tracklite's Introduction

Tracklite

Introduction

This repo using TensorRT to speed up yolov3 backbone and work with deep_sort torch. mainly run on Nvidia Jetson Nano but x64 may also works. haven't tried yet. note that it is a inference pipeline not for training model.

Thanks for ZQPei's great work. and also thanks to jkjung-avt for his tensorrt_demos, which give me a a lot to learn.


Update

2020.4.12

Release yolov3-tiny416 inference

2020.4.11

first upload the project


Speed

Whole process time from read image to finished deepsort (include every img preprocess and postprocess)

Backbone before TensorRT TensorRT(detection + tracking) FPS(detection + tracking)
Yolov3_416 750ms 450ms 1.5 ~ 2
Yolov3-tiny-416 N/A 100-150ms 8 ~ 9

Install

Environment

  • Jetson nano with TensorRT 5.1.6.1
  • Onnx 1.4.0 (or onnx 1.4.1, cannot be higher or lower)

follow my step to set up everything

  1. clone this repo
git clone xxxx
  1. Download YOLOv3 parameters
cd detector/YOLOv3/weight/
wget https://pjreddie.com/media/files/yolov3.weights
  1. Download deepsort parameters ckpt.t7
cd deep_sort/deep/checkpoint
# download ckpt.t7 from
https://drive.google.com/drive/folders/1xhG0kRH1EX5B9_Iz8gQJb7UNnn_riXi6 to this folder
  1. Compile nms
cd detector/YOLOv3/nms
sh build.sh

Convert yolov3 weights to onnx to tensorrt

  1. firstly check the yolo weights under weights directory and just simply command like below to convert yolov3.weights file to onnx, and onnx will be yielded at the same dir ( ./weights/yolov3_416.onnx )

    #if yolov3
    python3 yolov3_to_onnx.py
    #else yolov3_tiny
    python3 yolov3_tiny_to_onnx.py
  2. convert yolov3_416.onnx to tensorrt engine

    #if yolov3
    python3 onnx_to_tensorrt --onnx /path/to/yolov3_416.onnx --output_engine /path/to/yolov3_416.engine
    
    #else yolov3_tiny
    python3 onnx_to_tensorrt_tiny --onnx /path/to/yolov3_tiny_416.onnx --output_engine /path/to/yolov3_tiny_416.engine

    Note: In onnx_to_tensorrt.py , you can set max_workspace_size = 1 << 30 in get_engine function and delete builder.fp16_mode = True if you are using x86 arch for better performance (both mAP and frames per second)


Demo

support video and webcam demo for now

  1. Make sure everything is settled down
    • Yolov3_416 engine file
    • demo video you want to test on
  2. Let's do demo !

support

  1. onboard camera webcam / usb camera.
  2. Video track
  • Webcam demo - onboard camera, csi camera

    #yolov3
    python3 run_tracker.py
    
    #yolov3 tiny
    python3 run_tracker_tiny.py
  • Webcam demo - usb camera

    #yolov3
    python3 run_tracker.py --usb
    
    #yolov3 tiny
    python3 run_tracker_tiny.py --usb
  • Video demo

    #yolov3
    python3 run_tracker.py --file --filename your_test.mp4 --output_file ./output.mp4
    
    #yolov3 tiny
    python3 run_tracker_tiny.py --file --filename your_test.mp4 --output_file ./output.mp4

walking.gif

twice.gif


Issue

I had a hard time on saving video, now the VideoWriter works for me, but it might not work for you, issue me if you have any problem.

tracklite's People

Contributors

stephenfang51 avatar

Watchers

James Cloos 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.