Part of the upcoming tutorial from my blog poissonisfish featuring an example of my own.
- Install Python >= 3.7.0, available here
- Clone this repository to a local / remote machine
From a new terminal, after setting the repository as the working directory:
-
Install
pipenv
by runningpip install pipenv
-
Run
python -m venv <ENV_NAME>
to create thepip
environment -
Activate the
pip
environment using one of the following methods:
Platform | Shell | Command to activate virtual environment |
---|---|---|
POSIX | bash/zsh | $ source <ENV_NAME>/bin/activate |
fish | $ source <ENV_NAME>/bin/activate.fish |
|
csh/tcsh | $ source <ENV_NAME>/bin/activate.csh |
|
PowerShell Core | $ /bin/Activate.ps1 |
|
Windows | cmd.exe | C:\> <ENV_NAME>\Scripts\activate.bat |
PowerShell | PS C:\> <ENV_NAME>\Scripts\Activate.ps1 |
- Install required packages using
pip install -r requirements.txt
-
Create a
.MOV
video recording and move it to the working directory -
Run
./init.sh <PATH_TO_MOV>
to createinput
andoutput
directories, convert the.MOV
video to.mp4
and download theYOLOv3
dependencies for OpenCV. Please note this script requires the following utilities:ffmpeg
, available here for Linux, Windows and macOSwget
, readily available for Linux; Windows users can download wget.exe here and add the executable path to the system environment PATH variable; macOS users can get it from HomeBrew or similar
-
From the active environment, run
python tracker.py
and watch frame-by-frame computations while the annotated output video is written
This work is inspired by a project assignment from the course Computer Vision I at OpenCV.org.