Inpaint-Anything icon indicating copy to clipboard operation
Inpaint-Anything copied to clipboard

The Gradio Web UI segment mask shows the last image not current image

Open TianSong1991 opened this issue 1 year ago • 2 comments

It is an awesome segment project. I try your new web ui, but I see the wrong result in the web ui. result

First I load the baseball image, I click the image and obtain the result. Then I reset the web ui and I load the dog image.When I click the dog image and click the predict mask using sam. The segment result is last image not the current image.

TianSong1991 avatar Apr 26 '23 01:04 TianSong1991

I haven't seen such bug on my side. Can you give more details about how to reimplement the bug? We plan to upgrade the web UI this week. You can also check it out later.

geekyutao avatar Apr 26 '23 03:04 geekyutao

The main reason is that: the sam feature of a newly uploaded image is pre-computed before you click "Predict Masks Using SAM", which requires several seconds to finish; and if you click too fast, the local web ui will predict the masks using the sam feature of the previous image.

Now the bug is fixed :), you will get an error if you click very quickly, (don't forget to reset the web ui before uploading a new image).

RysonFeng avatar Apr 26 '23 06:04 RysonFeng

Thanks for all your reply. I will read your code and study it deeply. @RysonFeng @geekyutao

TianSong1991 avatar Apr 27 '23 08:04 TianSong1991