nrupatunga / goturn-pytorch

GOTURN tracking implemented in PyTorch
MIT License
84 stars 13 forks source link

GOTURN-PyTorch

PyTorch implementation of "Learning to Track at 100 FPS with Deep Regression Networks"

Report Bug · Request Feature

Table of Contents

About The Project

This repository contains the reimplementation of GOTURN in PyTorch. If you are interested in the following, you should consider using this repository

Tracking Demo

Face Surfer Face
Bike Bear

Getting Started

Code Setup

# Clone the repository
$ git clone https://github.com/nrupatunga/goturn-pytorch

# install all the required repositories
$ cd goturn-pytorch/src
$ pip install -r requirements.txt

# Add current directory to environment
$ source settings.sh

Data Download

cd goturn-pytorch/src/scripts
$ ./download_data.sh /path/to/data/directory

Training on custom dataset

Training

$ cd goturn-pytorch/src/scripts

# Modify the following variables in the script
# Path to imagenet
IMAGENET_PATH='/media/nthere/datasets/ISLVRC2014_Det/'
# Path to alov dataset
ALOV_PATH='/media/nthere/datasets/ALOV/'
# save path for models
SAVE_PATH='./caffenet/'

# open another terminal and run
$ visdom
# You can visualize the train/val images, loss curves,
# simply open https://localhost:8097 in your browser to visualize

# training
$ bash train.sh
Loss

Testing

In order to test the model, you can use the model in this link or you can use your trained model

$ mkdir goturn-pytorch/models

# Copy the extracted caffenet folder into models folder, if you are
# using the trained model

$ cd goturn-pytorch/src/scripts
$ bash demo_folder.sh

# once you run, select the bounding box on the frame using mouse, 
# once you select the bounding box press 's' to start tracking, 
# if the model lose tracking, please press 'p' to pause and mark the
# bounding box again as before and press 's' again to continue the
# tracking

# To test on a new video, you need to extract the frames from the video
# using ffmpeg or any other tool and modify folder path in
# demo_folder.sh accordingly

Known issues