Skip to content

Python scripts for performing 2D feature detection and tracking using the KP2D model in Pytorch

License

Notifications You must be signed in to change notification settings

ibaiGorordo/Pytorch-KP2D-Feature-Tracking

Repository files navigation

Pytorch-KP2D-Feature-Tracking

Python scripts for performing 2D feature detection and tracking using the KP2D model in Pytorch

KP2D 2D Feature matching Original images:https://github.com/liruoteng/OpticalFlowToolkit/blob/master/data/example/KITTI/

Requirements

  • 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.

Installation (Except Pytorch)

pip install -r requirements.txt
pip install pafy youtube_dl=>2021.12.17

Pretrained model

Download the original models KeypointNet and KeypointResnet and extract them into the models folder.

Original Repository

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.

Examples

  • 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

KP2D 2D Feature tracking drone

Original video: https://youtu.be/zP-gTCp5Kac

References:

Releases

No releases published

Packages

No packages published

Languages