# SuperPoint SuperGlue TensorRT
SuperPoint and SuperGlue with TensorRT. Deploy with C++.
## Demo
<img src="image/superpoint_superglue_tensorrt.gif" width = "640" height = "240" alt="match_image" border="10" />
* This demo was tested on the Quadro P620 GPU.
## Baseline
| Image Size: 320 x 240 | RTX3080 | Quadro P620 |
|:----------------------:|:-------:|:-----------:|
| SuperPoint (250 points)| 1.04 MS | 13.61 MS |
| SuperPoint (257 points)| 1.03 MS | 13.32 MS |
| SuperGlue (256 dims) | 7.47 MS | 58.83 MS |
| FPS (superpoint one time + superglue one time) | $\approx$ 117 FPS | $\approx$ 13 FPS |
## Docker(Recommand)
```bash
docker pull yuefan2022/tensorrt-ubuntu20.04-cuda11.6:latest
docker run -it --env DISPLAY=$DISPLAY --volume /tmp/.X11-unix:/tmp/.X11-unix --privileged --runtime nvidia --gpus all --volume ${PWD}:/workspace --workdir /workspace --name tensorrt yuefan2022/tensorrt-ubuntu20.04-cuda11.6:latest /bin/bash
```
## Environment required
* CUDA==11.6
* TensorRT==8.4.1.5
* OpenCV>=4.0
* EIGEN
* yaml-cpp
## Convert model(Optional)
The converted model is already provided in the [weights](./weights) folder, if you are using the pretrained model officially provided by [SuperPoint and SuperGlue](https://github.com/magicleap/SuperGluePretrainedNetwork), you do not need to go through this step.
```bash
python convert2onnx/convert_superpoint_to_onnx.py --weight_file superpoint_pth_file_path --output_dir superpoint_onnx_file_dir
python convert2onnx/convert_superglue_to_onnx.py --weight_file superglue_pth_file_path --output_dir superglue_onnx_file_dir
```
## Build and run
```bash
git clone https://github.com/yuefanhao/SuperPoint-SuperGlue-TensorRT.git
cd SuperPoint-SuperGlue-TensorRT
mkdir build
cd build
cmake ..
make
# test on image pairs 100 times, the output image will be saved in the build dir
./superpointglue_image ../config/config.yaml ../weights/ ${PWD}/../image/image0.png ${PWD}/../image/image1.png
# test on the folder with image sequence, output images will be saved in the param assigned dir
./superpointglue_sequence ../config/config.yaml ../weights/ ${PWD}/../image/freiburg_sequence/ ${PWD}/../image/freiburg_sequence/match_images/
```
The default image size param is 320x240, if you need to modify the image size in the config file, you should delete the old .engine file in the weights dir.
## Samples
```c++
#include "super_point.h"
#include "super_glue.h"
// read image
cv::Mat image0 = cv::imread("../image/image0.png", cv::IMREAD_GRAYSCALE);
cv::Mat image1 = cv::imread("../image/image1.png", cv::IMREAD_GRAYSCALE);
// read config from file
Configs configs("../config/config.yaml", "../weights/");
// create superpoint detector and superglue matcher
auto superpoint = std::make_shared<SuperPoint>(configs.superpoint_config);
auto superglue = std::make_shared<SuperGlue>(configs.superglue_config);
// build engine
superpoint->build();
superglue->build();
// infer superpoint
Eigen::Matrix<double, 259, Eigen::Dynamic> feature_points0, feature_points1;
superpoint->infer(image0, feature_points0);
superpoint->infer(image1, feature_points1)
// infer superglue
std::vector<cv::DMatch> superglue_matches;
superglue->matching_points(feature_points0, feature_points1, superglue_matches);
```
没有合适的资源?快使用搜索试试~ 我知道了~
TensorRT-使用TensorRT+Cpp部署SuperPoint+SuperGlue算法-优质算法部署项目实战.zip
共50个文件
png:20个
h:10个
cpp:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 2 下载量 56 浏览量
2024-02-28
16:21:51
上传
评论
收藏 209.43MB ZIP 举报
温馨提示
TensorRT_使用TensorRT+Cpp部署SuperPoint+SuperGlue算法_优质算法部署项目实战
资源推荐
资源详情
资源评论
收起资源包目录
TensorRT_使用TensorRT+Cpp部署SuperPoint+SuperGlue算法_优质算法部署项目实战.zip (50个子文件)
TensorRT_使用TensorRT+Cpp部署SuperPoint+SuperGlue算法_优质算法部署项目实战
inference_image.cpp 5KB
include
super_point.h 2KB
super_glue.h 3KB
read_config.h 4KB
utils.h 4KB
CMakeLists.txt 994B
weights
superglue_indoor_sim_int32.engine 62.54MB
superglue_outdoor_sim_int32.onnx 45.92MB
superpoint_v1_sim_int32.onnx 4.97MB
superglue_indoor_sim_int32.onnx 45.92MB
superpoint_v1_sim_int32.engine 8.86MB
superglue_outdoor_sim_int32.engine 62.53MB
image
freiburg_sequence
1341847987.758741.png 490KB
1341847985.746954.png 476KB
1341847980.722988.png 464KB
1341847996.874766.png 472KB
1341847994.866828.png 467KB
1341847984.743352.png 455KB
1341847995.870641.png 476KB
1341847989.802890.png 507KB
1341847982.730674.png 460KB
1341847983.738736.png 460KB
1341847981.726650.png 463KB
1341847986.762616.png 493KB
1341847992.818723.png 487KB
1341847988.769740.png 503KB
1341847993.826735.png 467KB
1341847991.814748.png 476KB
1341847990.810771.png 486KB
superpoint_superglue_tensorrt.gif 1.7MB
image1.png 463KB
image0.png 464KB
match_image.png 218KB
src
super_point.cpp 14KB
super_glue.cpp 21KB
inference_sequence.cpp 4KB
3rdparty
tensorrtbuffer
include
buffers.h 16KB
logger.h 1KB
logging.h 18KB
common.h 30KB
error_recorder.h 4KB
half.h 197KB
CMakeLists.txt 325B
src
logger.cpp 1KB
convert2onnx
superglue.py 12KB
convert_superpoint_to_onnx.py 3KB
convert_superglue_to_onnx.py 4KB
superpoint.py 8KB
README.md 3KB
config
config.yaml 626B
共 50 条
- 1
资源评论
- m0_668944762024-05-03资源有很好的参考价值,总算找到了自己需要的资源啦。
- FLALY2024-04-13资源很不错,内容和描述一致,值得借鉴,赶紧学起来!
极智视界
- 粉丝: 2w+
- 资源: 1459
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 写入三菱plcD位寄存器的值
- 确保你的操作系统符合Docker的要求 Docker支持的操作系统包括Ubuntu、Debian、CentOS、Fedora和m
- 确保你的操作系统符合Docker的要求 Docker支持的操作系统包括Ubuntu、Debian、CentOS、Fedora和m
- HDMI 虚拟软件欺骗器
- 确保你的操作系统符合Docker的要求 Docker支持的操作系统包括Ubuntu、Debian、CentOS、Fedora和m
- 读取三菱PLC D位寄存器
- HDMI edid 编辑工具
- 要在你的计算机上安装Docker,你可以按照以下步骤进行:
- 要在你的计算机上安装Docker,你可以按照以下步骤进行:
- html加JavaScript进行表单验证
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功