Apache License 2.0

项目介绍

yuefanhao/SuperPoint-SuperGlue-TensorRT 是一个托管在 GitHub 上的开源项目,主要使用 C++ 编写,采用 Apache License 2.0 许可证,目前获得 384 个 Star、59 次 Fork。

仓库全名
yuefanhao/SuperPoint-SuperGlue-TensorRT
开源许可证
Apache License 2.0
Star 数
384
Fork 数
59
未关闭 Issue
8

README 摘要

SuperPoint SuperGlue TensorRT SuperPoint and SuperGlue with TensorRT. Deploy with C++. Demo 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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

SuperPoint-SuperGlue-TensorRT 用什么语言开发?

主要使用 C++ 编写,采用 Apache License 2.0 许可证,目前有 384 个 Star。

SuperPoint-SuperGlue-TensorRT 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 SuperPoint-SuperGlue-TensorRT 的源码?

可以直接克隆仓库:git clone https://github.com/yuefanhao/SuperPoint-SuperGlue-TensorRT.git,默认分支为 main;安装与运行步骤见仓库 README。

SuperPoint-SuperGlue-TensorRT 最近还在维护吗?

仓库最近一次更新为 2024年4月23日,当前有 8 个未关闭 Issue;Star 数为 384,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

SuperPoint and SuperGlue with TensorRT. Deploy with C++.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
504
价值分
247
活跃状态
活跃

语言占比

C++
CMake
Python

Release

贡献者

README

SuperPoint SuperGlue TensorRT

SuperPoint and SuperGlue with TensorRT. Deploy with C++.

Demo

match_image
  • 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)

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 folder, if you are using the pretrained model officially provided by SuperPoint and SuperGlue, you do not need to go through this step.

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

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

#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);
 

Acknowledgements

SuperPoint SuperGlue TensorRT AirVO

评论

暂无评论