SiamMask implementation by Tensorflow 2
Project description
tf-siammask
SiamMask implementation with Tensorflow 2.
Example
import numpy as np
import PIL.Image
import siammask
sm = siammask.SiamMask()
# Weight files are automatically retrieved from GitHub Releases
sm.load_weights()
# Adjust this parameter for the better mask prediction
sm.box_offset_ratio = 1.5
img_prev = np.array(PIL.Image.open('data/cat1.jpg'))[..., ::-1]
box_prev = np.array([[227, 184], [381, 274]])
img_next = np.array(PIL.Image.open('data/cat2.jpg'))[..., ::-1]
# Predicted box and mask images is created if `debug=True`
box, mask = sm.predict(img_prev, box_prev, img_next, debug=True)
Test data
Previous frame | Next frame | |
---|---|---|
File name | ./data/cat1_with_box.jpg |
./data/cat2.jpg |
Image |
Predicted mask for ./data/cat2.jpg
TODO
- Bounding-box regression
- Mask refinement network
- Pre-trained model for Tensorflow 2.0
- Training code
- Object tracking code
Reference
@inproceedings{wang2019fast,
title={Fast online object tracking and segmentation: A unifying approach},
author={Wang, Qiang and Zhang, Li and Bertinetto, Luca and Hu, Weiming and Torr, Philip HS},
booktitle={Proceedings of the IEEE conference on computer vision and pattern recognition},
year={2019}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tf-siammask-1.0.1.tar.gz
(8.4 kB
view hashes)
Built Distribution
Close
Hashes for tf_siammask-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2f5111a9b9e931f4aacaeb1bcb3b1228741dfaccfdc3b4309d8a8b7ba93ce62 |
|
MD5 | 3b1c52437b74aeb30ccc02a86cf9e7e7 |
|
BLAKE2b-256 | b83557b50a01b23360b3fd5b5923fab567135a8514697366642f634a8032a8cb |