Git Product home page Git Product logo

img-siam's Introduction

IMG-Siam

A TensorFlow implementation of the IMG-Siam tracker

Introduction

This is a TensorFlow implementation of Initial Matting-Guided Visual Tracking with Siamese Network. The code is improved on the TensorFlow version of SiamFC here.

Prerequisite

Configuration environment

You can use TensorFlow > 1.0 for tracking though. Note the tracking performance slightly varies in different versions.

# pip install tensorflow    # For CPU
pip install tensorflow-gpu  # For GPU

# Other main modules
pip install sacred, scipy, opencv-python

# Matting needs
pip install scikit-image, scikit-learn, vlfeat-ctypes

# (OPTIONAL) Install nvidia-ml-py for automatically selecting GPU
pip install nvidia-ml-py

Clone this repository to your disk

git clone https://github.com/lazyfan/IMG-Siam.git

Tracking

In the initialization phase of the tracker, matting is performed on the initial frame.

Run the tracker on the specified sequence

You can place the sequence you want to track in the assets, where the sequence video is placed for reference.

(OPTIONAL) There are three matting programs available: sbbm, lbdm, ocsvm, you can modify it in configuration.py

python run_IMGSiam_tracker.py

Training

On the basis of SiamFC, attention module is added to the model, named SiamAtt in paper. The training steps are as follows:

1. Download dataset

Download and unzip the ImageNet VID 2015 dataset (~86GB) here.

2. Preprocess training data

python scripts/preprocess_VID_data.py
# Split train/val dataset and store corresponding image paths
python scripts/build_VID2015_imdb.py

3. Start training

(OPTIONAL) There are two attention modules available: se_block, cbam_block, you can modify it in configuration.py, se_block by default.

3.1 Start from scratch

python train_SiamAtt.py

3.2 Load SiamFC pretrained variables & Fine tune the later two layers

Download pretrained models.

python scripts/download_assets.py

Convert pretrained MatConvNet model into TensorFlow format.

# Note we use SiamFC-3s-color-pretrained as one example. You
# Can also use SiamFC-3s-gray-pretrained. 
python convert_pretrained_model.py

Modify trainable variable scope in train_SiamAtt.py and start train.

python train_SiamAtt.py

4. View the training progress in TensorBoard

# Open a new terminal session and cd to IMG-Siam, then
tensorboard --logdir=Logs/track_model_checkpoints/IMGSiam-3s-color

Reference

Paper

[1] Fully-Convolutional Siamese Networks for Object Tracking

[2] Squeeze-and-Excitation Networks

Repositories

[1] SiamFC tensorflow implementation

[2] initialisation-problem

[3] CBAM-TensorFlow-Slim

img-siam's People

Contributors

lazyfan avatar

Stargazers

zhu wang  avatar Md Maklachur Rahman avatar

Watchers

paper2code - bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.