Coder Social home page Coder Social logo

vanhaito / yolox-bytetrack-car-counter Goto Github PK

View Code? Open in Web Editor NEW
40.0 1.0 6.0 146.62 MB

Car tracking and car counter implemented with YOLOX, ByteTrack and Pytorch.

C++ 21.85% Python 75.54% Shell 0.46% CMake 0.34% Java 1.70% Makefile 0.11%
bytetrack pytorch tensorrt yolox object-counting object-detection vehicle-detection vehicle-tracking

yolox-bytetrack-car-counter's Introduction

YOLOX-ByteTrack-Car-Counter

Car tracking and car counter implemented with YOLOX, ByteTrack and Pytorch. We can take the ouput of YOLOX feed these object detections into ByteTrack in order to create a highly accurate object tracker. I have created a custom function within the file detector.py that can be used to count and keep track of the number of cars detected at a given moment within each video. In can be used to count total cars found or can count number of cars detected.

Demo of Car Counter in Action

Getting started

Pip

pip install -r requirements.txt
cd YOLOX
pip install -v -e .

Nvidia Driver

Make sure to use CUDA Toolkit version 11.2 as it is the proper version for the Torch version used in this repository: https://developer.nvidia.com/cuda-11.2.0-download-archive

torch2trt

Clone this repository and install: https://github.com/NVIDIA-AI-IOT/torch2trt

Download a pretrained model

Download pretrained yolox_s.pth file: https://github.com/Megvii-BaseDetection/YOLOX/releases/download/0.1.1rc0/yolox_s.pth

Copy and paste yolox_s.pth from your downloads folder into the 'YOLOX' folder of this repository.

Convert model to TensorRT

python tools/trt.py -n yolox-s -c yolox_s.pth

Runing Car Counter with YOLOX-s

In file detector.py you need to replace the file video name in line 131: .

Then run this command:

python detector.py

References

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.