Git Product home page Git Product logo

Comments (4)

dinglufe avatar dinglufe commented on August 16, 2024

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.

LightSun avatar LightSun commented on August 16, 2024

@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.

LightSun avatar LightSun commented on August 16, 2024

@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.

LightSun avatar LightSun commented on August 16, 2024

@dinglufe I fixed it by change image_size

from segment-anything-cpp-wrapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.