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
- We'll download the
cam1.mp4
andcam4.mp4
video files from the EPFL dataset.
Store then in a folder that is easy to access.
- Run the homography calibration:
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.
- Now, run the
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:
- NVIDIA GeForce 3060 Laptop GPU (6Gb).
- i7-11800H 16 Cores.
- Ubuntu 20.04 (LTS).
- CudaToolkit 11.8
- NVIDIA Driver 520.61.05
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.