Share interactive sam2(segment anything2) project

After segment anything 2 released, i wanted to implement simple image predictor in dash.

for it to work, point click, bbox selection feature needed which dash provide.
easy.gif

additionally, i found it cumbersome to alternative postive point, negative point in radio button.

Given observation that almost everyone draw bbox from top-left to bottom-right, i made few adjustment.

if user draw bbox from left-bottom to right-top, it draw positive point in starting location, and if user draw bbox from right-bottom to left-top, it draw negative point in starting position.

after this modification, using app give good interactivity.
advanced.gif

my github repo is future-158/dash-sam2-interactive: implement interactive image predictor using plotly dash (github.com)

3 Likes