Coder Social home page Coder Social logo

zllrunning / siamesex.pytorch Goto Github PK

View Code? Open in Web Editor NEW
439.0 13.0 93.0 52.86 MB

A simplified PyTorch implementation of Siamese networks for tracking: SiamFC, SiamRPN, SiamRPN++, SiamVGG, SiamDW, SiamRPN-VGG.

Python 100.00%
siamese-network siamese-fc siamvgg siamrpn tracking

siamesex.pytorch's Introduction

SiameseX.PyTorch

A simplified PyTorch implementation of Siamese networks for tracking: SiamFC, SiamVGG, SiamDW, SiamRPN, SiamRPN++.

Warning: It is still in development, some files are just for the integrity of the project.

Dependencies

  • python2.7
  • pytorch == 0.4.0
  • opencv
  • mmcv

Currently supported models

Backbones

  • AlexNet
  • VGG
  • ResNet22
  • Incep22
  • ResNeXt22
  • ResNet50

Demo

  • Try SiamFC:

Clone this repo and run

python demo.py --model SiamFC

You can change --mdoel to other models like

python demo.py --model SiamFCNext22
  • Try SiamRPN:

Download the pretrained model and put it in ./cp folder.

python demo_rpn.py --model SiamRPNResNeXt22
  • Try SiamRPN++:

Download the pretrained model and put it in ./cp folder.

python demo_rpn.py --model SiamRPNPPRes50
  • You'll see the following:

Training

  • download VID dataset (I did not use Youtube-bb because of limited resources).
  • download label files from here and run label_preprocess.py --file --output_file --path to replace my file path by yours, these three arguments should be treated carefully.
  • train SiamFCNext22 tracker
python train.py --gpu 0 --config configs/SiamFC.py
  • just replace --config argument and you can train other models
python train.py --gpu 0 --config configs/SiamRPN.py

TODO

We have accumulated the following to-do list, which we hope to complete in the near future

  • Still to come:
    • Add testing code on common datasets
    • Add SiamRPN(AlexNet as backbone)
    • Add SiamRPN(VGG as backbone)
    • Add SiamRPN(ResNet, ResNext, Inception as backbone)

Citation

@inproceedings{bertinetto2016fully,
  title={Fully-convolutional siamese networks for object tracking},
  author={Bertinetto, Luca and Valmadre, Jack and Henriques, Joao F and Vedaldi, Andrea and Torr, Philip HS},
  booktitle={European conference on computer vision},
  pages={850--865},
  year={2016},
  organization={Springer}
}

@inproceedings{Li2019SiamVGGVT,
  title={SiamVGG: Visual Tracking using Deeper Siamese Networks},
  author={Yuhong Li and Xiaofan Zhang},
  year={2019}
}

@inproceedings{SiamDW_2019_CVPR,
    author={Zhang, Zhipeng and Peng, Houwen},
    title={Deeper and Wider Siamese Networks for Real-Time Visual Tracking},
    booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
    year = {2019}

@article{li2018siamrpn++,
  title={SiamRPN++: Evolution of Siamese Visual Tracking with Very Deep Networks},
  author={Li, Bo and Wu, Wei and Wang, Qiang and Zhang, Fangyi and Xing, Junliang and Yan, Junjie},
  journal={arXiv preprint arXiv:1812.11703},
  year={2018}
}
}

References

siamesex.pytorch's People

Contributors

zllrunning avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

siamesex.pytorch's Issues

How to determine self.final_score_sz?

Hi, thank you for sharing the codes!
Given x_sz=255 and z_sz=127, the self.final_score_sz is set as 273. But how is 273 calculated?How can I determine self.final_score_sz in SiamVGGTracker for my dataset?
Also, hyparameters such as tot_stride and response_up are not clear. Could you provide breif explanations about them?
Your help would be much appreciated.

how to solve it?

when i excute the second command: python demo.py --model SiamFC
something is wrong like:

2019-05-01 15-40-12屏幕截图

transfer learning strategy

Hi.
Can you please share some transfer learning strategy to start with
without training from scratch?
thank you

Any plans for the cfnet?

Thanks for your nice work! It helps me a lot.

Are there plans for the cfnet, the siamfc-v2? I notice that there is not a Tensorflow or Pytorch version thus making it helpful if one did it.

Besides, I read your to-do lists and guess you are working for testing trackers on common datasets. GOT-10k toolkit is a useful tool for this, just a small suggestion.

Can you make a file to describe the right way to set import path?

I run the command python demo_rpn.py --model SiamRPNResNeXt22 in the directory "SiameseX.PyTorch", I got the error "from neck import AdjustLayer, AdjustAllLayer". Then, I changed it to from .neck import AdjustLayer, AdjustAllLayer and rerun that command, I got an another error "ImportError: cannot import name 'get_subwindow_tracking'".
Through your code, I found these problems are results from the disordered import path management.
So, Can you make a description to make them clear?

ModuleNotFoundError: No module named 'neck'

Whenever I try to run the demo code, I receive the following error:

Traceback (most recent call last):
  File "demo.py", line 10, in <module>
    from demo_utils.siamvggtracker import SiamVGGTracker
  File "C:\Users\Harinder\Desktop\SiameseX.PyTorch\demo_utils\siamvggtracker.py", line 12, in <module>
    from demo_utils.siamese import SiameseNet
  File "C:\Users\Harinder\Desktop\SiameseX.PyTorch\demo_utils\siamese.py", line 16, in <module>
    import models.builder as builder
  File "C:\Users\Harinder\Desktop\SiameseX.PyTorch\models\builder.py", line 10, in <module>
    from neck import AdjustLayer, AdjustAllLayer
ModuleNotFoundError: No module named 'neck'

Multiple tracker instances

Can this implementation handle multiple tracker instances to track several objects on a frame.
The reason for asking: SiamRPN PYSOT implementation cannot handle it, since SOT requires initialization.

how to use it for custom images/ videos?

Hi, can you provide any guidance in using this code for custom images/videos? what if i want to draw bounding box first and then track it? to make it more usable...thanks

Problem with pretrained weights

I've recently been attempting to run the demo_rpn.py script with the pretrained weights you have made available. Unfortunately, it appears that the weights don't match the model.

Placing a breakpoint at line 14 of demo_rpn_utils/utils.py and examining the model/loaded weights, I notice a disparity in the number of parameters:

For SiamRPNPPRes50
Weights in loaded dict: 458
Weights in state dict: 384

For SiamRPNResNeXt22
Weights in loaded dict: 180
Weights in state dict: 151

Any thoughts?

groundtruth

What does your groundtruth's mean,it has 8D vectors?

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.