Coder Social home page Coder Social logo

z-yan-0424 / tracking_by_detection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from higashikatazhangsuke/tracking_by_detection

0.0 0.0 0.0 224 KB

A system use yolov3/KCF&DSST/KF to detect,tracking and estimate the target location

License: Apache License 2.0

Python 100.00%

tracking_by_detection's Introduction

Tracking_by_detection

A Python3-based system use yolov3/KCF&DSST/KF to detect,tracking and estimate the target(people and cars) location. 这是我的本科毕设项目,主要通过YOLOv3识别,利用KCF-DSST-APCE完成抗遮挡的尺度变化跟踪,并用卡尔曼滤波估计位置。

视频效果/video :

https://www.bilibili.com/video/bv1Xa4y1Y7Ue

Test environment

Intel Core i5-8300H [email protected]

Nvidia GTX 1050Ti

Ubuntu 18.04LTS

Python3

OPENCV3.4.4

Requirements

CUDA9.0

CUDNN7

Python3

OPENCV

Numpy

Numba

Code structure

yolo.py:detect

fhog.py:give fhog feature

tracker.py:track

run.py:basic framework

run2.py:add more visualization work for some video

Cites and Others' codes' citation

@article{redmon2018yolov3, title={Yolov3: An incremental improvement}, author={Redmon, Joseph and Farhadi, Ali}, journal={arXiv preprint arXiv:1804.02767}, year={2018} }

@article{henriques2014high, title={High-speed tracking with kernelized correlation filters}, author={Henriques, Jo{~a}o F and Caseiro, Rui and Martins, Pedro and Batista, Jorge}, journal={IEEE transactions on pattern analysis and machine intelligence}, volume={37}, number={3}, pages={583--596}, year={2014}, publisher={IEEE} }

@inproceedings{danelljan2014accurate, title={Accurate scale estimation for robust visual tracking}, author={Danelljan, Martin and H{"a}ger, Gustav and Khan, Fahad and Felsberg, Michael}, booktitle={British Machine Vision Conference, Nottingham, September 1-5, 2014}, year={2014}, organization={BMVA Press} }

@inproceedings{wang2017large, title={Large margin object tracking with circulant feature maps}, author={Wang, Mengmeng and Liu, Yong and Huang, Zeyi}, booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition}, pages={4021--4029}, year={2017} }

The YOLOv3 part is based on yehengcheng's work @ https://github.com/yehengchen/Object-Detection-and-Tracking

The KCF and DSST part is based on ryanfwy's work @ https://github.com/ryanfwy/KCF-DSST-py

Install and use

First you should clone this repository and get yolo weight:

git clone https://github.com/sjtuzyz/Tracking_by_detection.git

go to yehengcheng's work to get the yolo weight or learn how to transfer it.

Then change some part of code to slove your task

Go to yolo.py line 122

if predicted_class != 'person':

The class should be changed to person or car or whatever you want.About the yolo network's training and convert,please check yehengcheng's work.

Go to tracker.py line 463

        if (APCE>0.12):#25 oc1.mp4 0.02 oc2.mp4
            x = self.getFeatures(image, 0, 1.0)
            self.train(x, self.interp_factor)
        #x = self.getFeatures(image, 0, 1.0)
        #self.train(x, self.interp_factor)

If you want to use APCE to let the system more robust to occlusions ,just change 0.12 to a threshold of your test video, which will be print in the terminal.

Go to run.py(or run2.py and find where to change by yourself)line 35

cap = cv2.VideoCapture('./outputcar1.mp4')

Change to .mp4 file to test your own video.

Go to run.py(or run2.py and find where to change by yourself)line 50-78 and 109-136

I use similar geometric relations to calculate the distance,which means you need to get the Intrinsic Matrix K by Matlab or any other code and target's height or width first.Then just change the parameters to yours.

Go to run.py(or run2.py and find where to change by yourself)line 205

c = cv2.waitKey(1) & 0xFF

change the waitkey to get the frame played slower.

tracking_by_detection's People

Contributors

higashikatazhangsuke 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.