Skip to content

Commit

Permalink
push codes
Browse files Browse the repository at this point in the history
  • Loading branch information
StrangerZhang committed May 12, 2019
1 parent 7aefc77 commit c7fd71c
Showing 74 changed files with 6,753 additions and 1 deletion.
107 changes: 107 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

testing_dataset/*
experiments
46 changes: 46 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Installation

This document contains detailed instructions for installing dependencies for PySOT. We recommand using the [install.sh](install.sh). The code is tested on an Ubuntu 16.04 system with Nvidia GPU (We recommand 1080TI / TITAN XP).

### Requirments
* Conda with Python 3.7.
* Nvidia GPU.
* PyTorch 0.4.1
* yacs
* pyyaml
* matplotlib
* tqdm
* OpenCV

## Step-by-step instructions

#### Create environment and activate
```bash
conda create --name pysot python=3.7
conda activate pysot
```

#### Install numpy/pytorch/opencv
```
conda install numpy
conda install pytorch=0.4.1 torchvision cuda90 -c pytorch
pip install opencv-python
```

#### Install other requirements
```
pip install pyyaml yacs tqdm colorama matplotlib cython tensorboardX
```

#### Build extensions
```
python setup.py build_ext --inplace
```


## Try with scripts
```
bash install.sh /path/to/your/conda pysot
```

## Downloading dataset
32 changes: 32 additions & 0 deletions MODEL_ZOO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# PySOT Model Zoo

## Introduction

This file documents a large collection of baselines trained with pysot. All configurations for these baselines are located in the `experiments` directory. The tables below provide results about inference. Links to the trained models as well as their output are provided.

## Visual Tracking Baselines

### Short-term Tracking

| <sub>Model</br>(arch+backbone+xcorr)</sub> | <sub>VOT2016</br> (EAO/A/R) </sub> | <sub>VOT2018</br> (EAO/A/R) </sub> | <sub>OTB2015</br> (AUC/Prec.) </sub> | <sub>VOT2018-LT</br>(F1)</sub> | <sub>Speed</br> (fps) </sub> | <sub>Download</sub> |
|:----------------------------------------:|:-:|:------------------------:|:--------------------:|:----------------:|:--------------:|:------------:|
| <sub>siamrpn_alex_dwxcorr</sub> | <sub>0.393/0.618/0.238</sub> | <sub>0.352/0.576/0.290</sub> | - | - | <sub>180</sub> | [link](https://drive.google.com/open?id=1t62x56Jl7baUzPTo0QrC4jJnwvPZm-2m) |
| <sub>siamrpn_alex_dwxcorr_otb</sub> | | - | <sub>0.666/0.876</sub> | - | <sub>180</sub> | [link](https://drive.google.com/open?id=1gCpmR85Qno3C-naR3SLqRNpVfU7VJ2W0) |
| <sub>siamrpn_r50_l234_dwxcorr</sub> | <sub>0.464/0.642/0.196</sub> | <sub>0.415/0.601/0.234</sub> | - | - | <sub>35</sub> | [link](https://drive.google.com/open?id=1Q4-1563iPwV6wSf_lBHDj5CPFiGSlEPG) |
| <sub>siamrpn_r50_l234_dwxcorr_otb</sub> | | - | <sub>0.696/0.914</sub> | - | <sub>35</sub> | [link](https://drive.google.com/open?id=1Cx_oHu6o0gNeH7F9zZrgevfAGdyWC4D5) |
| <sub>siamrpn_mobilev2_l234_dwxcorr</sub> | <sub>0.455/0.624/0.214</sub> | <sub>0.410/0.586/0.229</sub> | - | - | <sub>75</sub> | [link](https://drive.google.com/open?id=1JB94pZTvB1ZByU-qSJn4ZAIfjLWE5EBJ) |
| <sub>siammask_r50_l3</sub> | | <sub>0.407/0.598/0.243</sub> | - | - | <sub>56</sub> | [link](https://drive.google.com/open?id=1YbPUQVTYw_slAvk_DchvRY-7B6rnSXP9) |
| <sub>siamrpn_r50_l234_dwxcorr_lt</sub> | | - | - | <sub>0.629</sub> | <sub>20</sub> | [link](https://drive.google.com/open?id=1lOOTedwGLbGZ7MAbqJimIcET3ANJd29A) |

Note:

- speed tested on GTX-1080Ti


### Video Object Segmentation Baselines


## License

All models available for download through this document are licensed under the [Creative Commons Attribution-ShareAlike 3.0 license](https://creativecommons.org/licenses/by-sa/3.0/).

39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -44,7 +44,44 @@ Please find installation instructions for PyTorch and PySOT in [`INSTALL.md`](IN

## Quick Start: Using PySOT

After installation, please see [`GETTING_STARTED.md`](GETTING_STARTED.md) for brief tutorials covering inference and training with PySOT.
### Add PySOT to your PYTHONPATH
```bash
export PYTHONPATH=/path/to/PySOT:$PYTHONPATH
```

### Download models
Download models in [PySOT Model Zoo](MODEL_ZOO.md) and put the model.pth in the correct directory in experiments

### Webcam demo
```bash
python tools/demo.py \
--config experiments/siamrpn_r50_l234_dwxcorr/config.yaml \
--snapshot experiments/siamrpn_r50_l234_dwxcorr/model.pth \
# --video demo/bag.avi # (in case you don't have webcam)
```

### Download testing datasets
Download datasets and putting them into testing_dataset directory, please refer to [pysot-toolkit](https://github.com/StrangerZhang/pysot-toolkit) to setting testing_dataset

### Test tracker
```bash
cd experiments/siamrpn_r50_l234_dwxcorr
python -u ../../tools/test.py \
--snapshot model.pth \ # model path
--dataset VOT2018 \ # dataset name
--config config.yaml # config file
```
The testing results will in the current directory(results/dataset/model_name/)

### Eval tracker
assume still in experiments/siamrpn_r50_l234_dwxcorr
``` bash
python ../../tools/eval.py \
--tracker_path ./results \ # result path
--dataset VOT2018 \ # dataset name
--num 1 \ # number thread to eval
--tracker_prefix 'model' # tracker_name
```

## References

Binary file added demo/bag.avi
Binary file not shown.
37 changes: 37 additions & 0 deletions experiments/siammask_r50_l3/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
META_ARC: "siamrpn_r50_l234_dwxcorr"

BACKBONE:
TYPE: "pysot.models.backbone.resnet_atrous.resnet50"
LAYERS: [0, 1, 2, 3]
CHANNELS: [1024]

ADJUST:
ADJUST: true
TYPE: "pysot.models.neck.neck.AdjustAllLayer"
ADJUST_CHANNEL: [256]

RPN:
TYPE: 'pysot.models.head.rpn.DepthwiseRPN'

MASK:
MASK: True
MASK_TYPE: 'pysot.models.head.mask.MaskCorr'
REFINE: True
REFINE_TYPE: 'pysot.models.head.mask.Refine'

ANCHOR:
STRIDE: 8
RATIOS: [0.33, 0.5, 1, 2, 3]
SCALES: [8]
ANCHOR_NUM: 5

TRACK:
TYPE: 'pysot.tracker.siammask_tracker.SiamMaskTracker'
PENALTY_K: 0.10
WINDOW_INFLUENCE: 0.41
LR: 0.32
EXEMPLAR_SIZE: 127
INSTANCE_SIZE: 255
BASE_SIZE: 8
CONTEXT_AMOUNT: 0.5
MASK_THERSHOLD: 0.15
33 changes: 33 additions & 0 deletions experiments/siamrpn_alex_dwxcorr/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
META_ARC: "siamrpn_alex_dwxcorr"

BACKBONE:
TYPE: "pysot.models.backbone.alexnet.alexnet"
LAYERS: [-1]
CHANNELS: [256]
WIDTH_MULT: 1.

ADJUST:
ADJUST: False

RPN:
TYPE: 'pysot.models.head.rpn.DepthwiseRPN'
WEIGHTED: False

MASK:
MASK: False

ANCHOR:
STRIDE: 8
RATIOS: [0.33, 0.5, 1, 2, 3]
SCALES: [8]
ANCHOR_NUM: 5

TRACK:
TYPE: 'pysot.tracker.siamrpn_tracker.SiamRPNTracker'
PENALTY_K: 0.16
WINDOW_INFLUENCE: 0.40
LR: 0.30
EXEMPLAR_SIZE: 127
INSTANCE_SIZE: 287
BASE_SIZE: 0
CONTEXT_AMOUNT: 0.5
35 changes: 35 additions & 0 deletions experiments/siamrpn_mobilev2_l234_dwxcorr/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
META_ARC: "siamrpn_mobilev2_l234_dwxcorr"

BACKBONE:
TYPE: "pysot.models.backbone.mobile_v2.mobilenetv2"
LAYERS: [3, 5, 7]
WIDTH_MULT: 1.4
CHANNELS: [44, 134, 448]

ADJUST:
ADJUST: true
TYPE: "pysot.models.neck.neck.AdjustAllLayer"
ADJUST_CHANNEL: [256, 256, 256]

RPN:
TYPE: 'pysot.models.head.rpn.MultiRPN'
WEIGHTED: False

MASK:
MASK: False

ANCHOR:
STRIDE: 8
RATIOS: [0.33, 0.5, 1, 2, 3]
SCALES: [8]
ANCHOR_NUM: 5

TRACK:
TYPE: 'pysot.tracker.siamrpn_tracker.SiamRPNTracker'
PENALTY_K: 0.04
WINDOW_INFLUENCE: 0.4
LR: 0.5
EXEMPLAR_SIZE: 127
INSTANCE_SIZE: 255
BASE_SIZE: 8
CONTEXT_AMOUNT: 0.5
34 changes: 34 additions & 0 deletions experiments/siamrpn_r50_l234_dwxcorr/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
META_ARC: "siamrpn_r50_l234_dwxcorr"

BACKBONE:
TYPE: "pysot.models.backbone.resnet_atrous.resnet50"
LAYERS: [2, 3, 4]
CHANNELS: [512, 1024, 2048]

ADJUST:
ADJUST: true
TYPE: "pysot.models.neck.neck.AdjustAllLayer"
ADJUST_CHANNEL: [256, 256, 256]

RPN:
TYPE: 'pysot.models.head.rpn.MultiRPN'
WEIGHTED: True

MASK:
MASK: False

ANCHOR:
STRIDE: 8
RATIOS: [0.33, 0.5, 1, 2, 3]
SCALES: [8]
ANCHOR_NUM: 5

TRACK:
TYPE: 'pysot.tracker.siamrpn_tracker.SiamRPNTracker'
PENALTY_K: 0.05
WINDOW_INFLUENCE: 0.42
LR: 0.38
EXEMPLAR_SIZE: 127
INSTANCE_SIZE: 255
BASE_SIZE: 8
CONTEXT_AMOUNT: 0.5
Loading

0 comments on commit c7fd71c

Please sign in to comment.