百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

SiamMaskCpp

> 开发工具
开源

SiamMask 的 C++ 实现

100 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

SiamMask 的 C++ 实现

SiamMaskCpp

  • C++ Implementation of SiamMask
  • Porting slogan:
    • numpy operations → cv::Mat operations
    • CNNs → torch::jit::script::Module
    • Other tensor operations → torch::Tensor operations
  • Faster than the original implementation (speed increased from 22fps to 40fps when tested with a single NVIDIA GeForce GTX 1070)

Requirements

  • OpenCV >= 3 (tested with 3.4.0)
  • PyTorch >= 1 (tested with 1.3.0)

Convert a SiamMask model to Torch scripts

You can use the models (with the refine module) trained with the original repository foolwood/SiamMask for inference in C++. Just Follow the instruction in jiwoong-choi/SiamMask to convert your own models to Torch script files.

Download pretrained Torch scripts

Or you can download pretrained Torch scripts. These files are converted from the pretrained models (SiamMask_DAVIS.pth and SiamMask_VOT.pth) in the original repository.

bash
git clone --recurse-submodules https://github.com/nearthlab/SiamMaskCpp
cd SiamMaskCpp
mkdir models
cd models
wget https://github.com/nearthlab/SiamMaskCpp/releases/download/v1.0/SiamMask_DAVIS.tar.gz
wget https://github.com/nearthlab/SiamMaskCpp/releases/download/v1.0/SiamMask_VOT.tar.gz
tar -xvzf SiamMask_DAVIS.tar.gz
tar -xvzf SiamMask_VOT.tar.gz

Before building demo, make sure the following command prints out the correct path to torch install directory.

bash
python3 -c "import torch; print(torch.__path__[0])"
# /path/to/lib/python3.x/site-packages/torch

How to build demo

bash
cd SiamMaskCpp
mkdir build
cd build
# specify -DTORCH_PATH=/path/to/lib/python3.x/site-packages/torch if cmake fails to detect PyTorch automatically
cmake ..
make

# Move the executable file to the repository directory
mv demo ..

How to run demo

bash
cd SiamMaskCpp
./demo -c config_davis.json -m models/SiamMask_DAVIS tennis
./demo -c config_vot.json -m models/SiamMask_VOT tennis

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++computer-visiondeep-learningpytorch-cppreal-time

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具