Comments (4)
Perhaps it's a display issue with OpenCV (clicking the close button might solve it).
Have you tried testing it using the API instead of the executable demo?
from segment-anything-cpp-wrapper.
@dinglufe I compile your lib self, Why did you say may be display issue with OpenCV? SAM demo I tried online, but mask don't have offset. I tried to read you c++ code and didn't find 'Which cause the offset '.
from segment-anything-cpp-wrapper.
@dinglufe I found the SAM script of export onnx have this.
dummy_inputs = {
"image_embeddings": torch.randn(1, embed_dim, *embed_size, dtype=torch.float),
"point_coords": torch.randint(low=0, high=1024, size=(1, 5, 2), dtype=torch.float),
"point_labels": torch.randint(low=0, high=4, size=(1, 5), dtype=torch.float),
"mask_input": torch.randn(1, 1, *mask_input_size, dtype=torch.float),
"has_mask_input": torch.tensor([1], dtype=torch.float),
"orig_im_size": torch.tensor([1500, 2250], dtype=torch.float),
}
But your 'export_pre_module.py' assign the image size 'image_size = (1024, 720)'. Is this the cause ?
from segment-anything-cpp-wrapper.
@dinglufe I fixed it by change image_size
from segment-anything-cpp-wrapper.
Related Issues (20)
- cuda issue
- 想问一下,推断之后如何缩放尺寸到原图大小而不是1024*720
- 请问可以同时在一张图片上推断两个roi吗
- hasMaskValues这个输入是啥
- Segment Anything CPP Wrapper for macOS HOT 2
- 请问这个如何能改成多个bbx的提示框
- Can you show all the test project code.I cann't run in my compute after I create a new project and and test.cpp into project. HOT 1
- if change cuda ,loading model is fail,what's wrong? HOT 4
- Questions about the speed at which the model runs HOT 2
- help!!! I use it as this,but get error:not enough space: expected 4194304, got 0. My memory is enough.What's wrong? HOT 3
- can run in cpu? HOT 1
- How to change the image size, still only 1024x720? HOT 2
- Could you make stable-diffusion-onnx-cpp-wrapper.exe, please? HOT 4
- Why I don't get as good results as you do in the python environment, I'm curious to know how you did it and what tips you have. HOT 2
- 'SamPredictor' object has no attribute 'interm_features' HOT 1
- cuda mode problem HOT 1
- opencv2/opencv.hpp: No such file or directory HOT 1
- What should I do if the input size of the modified image is 640x480, and the obtained mask cannot coincide with the original image? HOT 3
- Image input 320x240 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from segment-anything-cpp-wrapper.