Git Product home page Git Product logo

object-tracker's Introduction

object-tracker

Image

Real-Time Object Tracker written in Python using dlib and OpenCV | Video 1 Video 2


Quick Links

Dependencies

Starting the code

Tracking can either be done using a live video from a webcam or using a video file.

Tracking using Video File

To run the code using a video file use the following command line argument --

python object-tracker-single.py -v <path-2-video-file>

For example, you can use the demo video provided with this code as --

python object-tracker-single.py -v demo-video-single.avi

Tracking using Live Video

To run the code using live video use the following command line argument --

python object-tracker-single.py -d <device-id>

For example, on most systems device id 0 is the webcam attached.

python object-tracker-single.py -v docs/demo-single-video.avi

Use the -l or `--dispLoc' command line option to display the locations of the tracked object as show below -

python object-tracker-single.py -v docs/demo-single-video.avi -l

NOTE -- If you want to do multi object tracking code, use the file object-tracker-multi.py instead of object-tracker-single.py. This is a hack to do multi-object tracking and hence the code slows down.

How to perform tracking

Once the code starts, it will start the video file or the live stream. To select the objects to be tracked, pause the video by pressing the p key.The next step is to create a bounding box around the object(s) to be tracked. Press the mouse to select the top-left pixel location of the object to be tracked and then release the mouse on the bottom-right location of the object to be tracked. Once, this is done press p to start the tracking. Also, if you want to discard the object, press the d key. In SINGLE OBJECT TRACKING MODE, you can only select one object but in MULTI OBJECT TRACKING MODE, you can select as many objects you want but at the cost of speed. Press esc anytime to gracefully quit the code.

object-tracker's People

Contributors

bikz05 avatar adithyaselv avatar powderblock 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.