Skip to content

Commit 5a90686

Browse files
committed
update README for superpoint
1 parent 98aca9f commit 5a90686

File tree

5 files changed

+37
-4
lines changed

5 files changed

+37
-4
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Hope that they both are helpful for your work.
88
## TODO
99

1010
- [x] Support inference of multi-inputs, multi-outputs
11-
- [x] Examples for famous models, like yolov3, mask-rcnn, [ultra-light-weight face detector](https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB), [yolox](https://github.com/Megvii-BaseDetection/YOLOX), [PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.3). Might consider supporting more if requested
11+
- [x] Examples for famous models, like yolov3, mask-rcnn, [ultra-light-weight face detector](https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB), [yolox](https://github.com/Megvii-BaseDetection/YOLOX), [PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.3), [SuperPoint](https://github.com/magicleap/SuperPointPretrainedNetwork). Might consider supporting more if requested
1212
- [ ] Batch-inference
1313

1414
## Installation
@@ -228,3 +228,35 @@ wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/0.1.1rc0/yo
228228
+ test result on a new scene at Odaiba, Tokyo, Japan
229229

230230
![paddleseg odaiba](./data/images/odaiba_result.jpg)
231+
232+
### [SuperPoint](https://arxiv.org/pdf/1712.07629.pdf)
233+
234+
---
235+
236+
![super_point_good_matches](./data/images/super_point_good_matches.jpg)
237+
238+
<details>
239+
240+
- Convert SuperPoint's pretrained weights to onnx format
241+
242+
```bash
243+
git submodule update --init --recursive
244+
python3 -m pip install -r scripts/superpoint/requirements.txt
245+
python3 scripts/superpoint/convert_to_onnx.py
246+
```
247+
248+
- Download test images from [this dataset](https://github.com/StaRainJ/Multi-modality-image-matching-database-metrics-methods)
249+
250+
```bash
251+
wget https://raw.githubusercontent.com/StaRainJ/Multi-modality-image-matching-database-metrics-methods/master/Multimodal_Image_Matching_Datasets/ComputerVision/CrossSeason/VisionCS_0a.png -P data
252+
253+
wget https://raw.githubusercontent.com/StaRainJ/Multi-modality-image-matching-database-metrics-methods/master/Multimodal_Image_Matching_Datasets/ComputerVision/CrossSeason/VisionCS_0b.png -P data
254+
```
255+
256+
- Test inference apps
257+
258+
```bash
259+
./build/examples/super_point ./scripts/superpoint/super_point.onnx data/VisionCS_0a.png data/VisionCS_0b.png
260+
```
261+
262+
</details>
462 KB
Loading

examples/SuperPointApp.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ int main(int argc, char* argv[])
8686
cv::Scalar::all(-1), cv::Scalar::all(-1), std::vector<char>(),
8787
cv::DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS);
8888
cv::imwrite("super_point_good_matches.jpg", matchesImage);
89+
cv::imshow("super_point_good_matches", matchesImage);
90+
cv::waitKey();
8991

9092
return EXIT_SUCCESS;
9193
}
@@ -199,7 +201,6 @@ KeyPointAndDesc processOneFrame(const Ort::SuperPoint& osh, const cv::Mat& input
199201
float confidenceThresh, bool alignCorners, int distThresh)
200202
{
201203
int origW = inputImg.cols, origH = inputImg.rows;
202-
std::vector<float> originImageSize{static_cast<float>(origH), static_cast<float>(origW)};
203204
cv::Mat scaledImg;
204205
cv::resize(inputImg, scaledImg, cv::Size(Ort::SuperPoint::IMG_W, Ort::SuperPoint::IMG_H), 0, 0, cv::INTER_CUBIC);
205206
osh.preprocess(dst, scaledImg.data, Ort::SuperPoint::IMG_W, Ort::SuperPoint::IMG_H, Ort::SuperPoint::IMG_CHANNEL);

examples/Utility.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
#pragma once
1313

1414
#include <algorithm>
15-
#include <opencv2/core/fast_math.hpp>
16-
#include <stdexcept>
1715
#include <string>
16+
#include <utility>
1817
#include <vector>
1918

2019
#include <opencv2/opencv.hpp>

scripts/superpoint/convert_to_onnx.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def main():
3737
"output": {0: "batch_size"},
3838
},
3939
)
40+
print(f"\nonnx model is saved to: {os.getcwd()}/super_point.onnx")
4041

4142

4243
if __name__ == "__main__":

0 commit comments

Comments
 (0)