Python scripts for performing 2D feature detection and tracking using the KP2D model in Pytorch
Original images:https://github.com/liruoteng/OpticalFlowToolkit/blob/master/data/example/KITTI/
- Check the requirements.txt file.
- For Pytorch, check the official website to install the version matching your machine: https://pytorch.org/
- Additionally, pafy and youtube-dl are required for youtube video inference.
pip install -r requirements.txt
pip install pafy youtube_dl=>2021.12.17
Download the original models KeypointNet and KeypointResnet and extract them into the models folder.
The original repository contains additional code to train the models in Pytorch. This repository uses part of that code to make it easier to use the model in videos, images and webcamera.
- Image Feature Matching:
python image_feature_matching.py
- Image Feature Detection Confidence:
python image_feature_detection_conf.py
- Video Feature tracking:
python video_feature_tracking.py
- Webcam Feature Tracking:
python webcam_feature_tracking.py
Inference video Example: https://youtu.be/IeeRWMhpyc0
Original video: https://youtu.be/zP-gTCp5Kac
- KP2D original repository: https://github.com/TRI-ML/KP2D
- Original paper: https://openreview.net/pdf?id=Skx82ySYPH