To install, run:
conda create -n mc-mot python=3.10
NOTE: If you already have one conda env, just move to the next step.
conda install pytorch torchvision pytorch-cuda=your-cuda-version -c pytorch -c nvidia
Replace the your-cuda-version
text by your CUDA version. You can check that with nvidia-smi
.
However, if you don't have a GPU from NVIDIA, you can use the CPU version of PyTorch. Then, you can just install with pip
:
pip install torch torchvision
Then, we can just install the other dependencies with:
pip install -r requirements.txt
cam1.mp4
and cam4.mp4
video files from the EPFL dataset.Store then in a folder that is easy to access.
python3 calibrate.py --video1 /path/to/cam1.mp4 --video2 /path/to/cam4.mp4 --homography-pth /path/to/save/the/homography/matrix
You can also do python3 calibrate.py --help
At the end, you'll visualize how the bounding boxes are being projected from one camera to the other one.
main.py
:python3 main.py --video1 /path/to/cam1.mp4 --video2 /path/to/cam4.mp4 --homography /path/to/homography/matrix.npy
For the other parameters, run:
python3 main.py --help
This repository was tested with the following specs:
You should have similar results with similar hardware as above.
If you run on a CPU, try to change the Yolo model to the smaller one.