SAM Model: Box and Point Input #1301
cm107
started this conversation in
Ideas / Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In order to make it easier to generate the polygons that I desire, I would like to be able to specify a box input in addition to the point input.
It's pretty straightforward what needs to be done with the model's input. Refer to the Example box and point input section of onnx_model_example.ipynb.
For now I am using a modified version of _compute_polygon_from_points in order to accomplish this:
See Code
Basically, when there are 3 or more points in the points list, I'm just using the first two points as the top-left corner and bottom-right corner of the box. The rest of the points are used as positive/negative point prompts as usual. Doing this gets the job done, but there is no visualization for the box.
Ideally, I think that the points and box should be created using different buttons:
Left Mouse Button: Positive Point
Shift + Left Mouse Button: Negative Point
Middle Mouse Button (On Button Press): Set Top-Left Corner of Box
Middle Mouse Button (On Button Release): Set Bottom-Right Corner of Box
Can someone implement this with a visualization for the box?
Beta Was this translation helpful? Give feedback.
All reactions