OroChippw/SegmentAnything-OnnxRunner

where is the model?

Opened this issue · 6 comments

where is the model?
std::string encoder_model_path = "E:\\OroChiLab\\segment-anything-main\\models\\raw\\sam_preprocess.onnx";
decoder_model_path = "E:/OroChiLab/segment-anything-main/model_weights/sam_vit_b_singlemask.onnx";
decoder_model_path = "E:/OroChiLab/segment-anything-main/model_weights/withEncoder/vit_b/decoder.onnx";

How to get three models?

std::string encoder_model_path = "E:\\OroChiLab\\segment-anything-main\\models\\raw\\sam_preprocess.onnx";
decoder_model_path = "E:/OroChiLab/segment-anything-main/model_weights/sam_vit_b_singlemask.onnx";
decoder_model_path = "E:/OroChiLab/segment-anything-main/model_weights/withEncoder/vit_b/decoder.onnx";

How to get three models?

I will update the README.md tomorrow ,if you want to build sam_preprocess.onnx .you can look this file https://github.com/OroChippw/segment-anything/blob/master/export_pre_model.py
Thank you for your attention and questions😁

Thank you for your reply.
And I can't find SAM. h yet.
#include "../SAMWrapper/SAM.h" in sam.cpp

Thank you for your reply. And I can't find SAM. h yet. #include "../SAMWrapper/SAM.h" in sam.cpp

You can directly look at these three files ,copy it to rebuild,SAMOnnxRunner.cpp 、 SAMOnnxRunner.h 、main.cpp
the file sam.cpp is useless , i will delete it later . I am very glad that you can help me point out the problem
Thanks again😃

博主你好,你的代码对我帮助很大!我在Vs上跑通了你的代码,我有两个问题
1.演示时左键是选取兴趣区域,右键起到什么作用呢,源码中的区别好像是positive
2.SAM演示过程中能否选取框,该如何操作。

博主你好,你的代码对我帮助很大!我在Vs上跑通了你的代码,我有两个问题 1.演示时左键是选取兴趣区域,右键起到什么作用呢,源码中的区别好像是positive 2.SAM演示过程中能否选取框,该如何操作。

1、准确来说 左键是给予模型positive的正向点,告诉模型这是感兴趣区域,而右键则是继续一个negative的消极点,告诉模型所点击的区域不包含目标物体,目前代码里面只实现了单步的操作 所以只有positive
2、目前代码只是一个调用示范,对于选取框目前只支持代码里面更改,后续会添加进演示中
3、才学习了C++一个月不是很熟悉规范的代码结构,后续会持续进行改进,感谢您的关注希望你能提供更宝贵的建议,谢谢~😀