vietanhdev / anylabeling

Effortless AI-assisted data labeling with AI support from YOLO, Segment Anything, MobileSAM!!
https://anylabeling.nrl.ai
GNU General Public License v3.0
2.04k stars 222 forks source link

bad segmentation #119

Closed nisanaryal-MTEG closed 1 year ago

nisanaryal-MTEG commented 1 year ago

I just updated to 0.3.2 and there seems to be some issue. The segmentation mask is wrong for mobileSAM as well as Vit-b version.(gives almost all the images as output). I think this is due to some error during the latest update. Please review it.

nisanaryal-MTEG commented 1 year ago

Previously, I had made a user version of SAM and it was working fine. I tried with that one and the following error occurred. I hope it will be helpful to find the bug. image

nisanaryal-MTEG commented 1 year ago

from pip, 0.2.24 is working fine, something went wrong in 0.3.0.

Hope this will be helpful.

vietanhdev commented 1 year ago

@nisanaryal-MTEG Thank you for testing out. The models need to be exported by samexporter https://github.com/vietanhdev/samexporter. Previous models may not be compatible. Have you downloaded new models using the UI?

nisanaryal-MTEG commented 1 year ago

@vietanhdev I just selected the model from the option, the models are auto downloaded aren't they?. If not then the problem might be because of local downloaded file with the same name from previous version.

I created the onnx with my own code and matched the input and output after watching the documentation. I did not know that there was a separate repository for onnx, thanks for the hard work.

nisanaryal-MTEG commented 1 year ago

image I selected a model that I normally dont use and tested it, the error still exits.

image The output comes as the whole image.

I am using windows and install/upgraded using PIP.

I think there is some problem.

vietanhdev commented 1 year ago

@nisanaryal-MTEG There is an issue here: Labeling UI is not blocked while downloading the model. Please wait until the message "Downloading http..." disappears. I will fix this issue in the next version.

vietanhdev commented 1 year ago

For the MobileSAM, please note that it has been only trained on 1% of the SAM dataset. Maybe the generalization is not as good as the original models, causing bad results on special objects or domains (just my guess).

nisanaryal-MTEG commented 1 year ago

@vietanhdev sorry for the confusion, the model downloaded properly last time, I just took the image to convey that I am using the latest version of model.

I converted MobileSAM to onnx with my code and tested on 0.2.24, it is working fine. All the models are giving wrong output from 0.3.0. The surgical image from previous comment was from vit-l.

I have not tried on another PC yet so this might be a local problem as well. I will get back to you after testing on another pc.

vietanhdev commented 1 year ago

Could you try following:

ydzhang12345 commented 1 year ago

same here. Results are really bad for v0.3.2 (no matter where I prompt the image using whatever models). Using v0.2.24 is fine

vietanhdev commented 1 year ago

@nisanaryal-MTEG @ydzhang12345 Could you help me to test v0.3.3? https://github.com/vietanhdev/anylabeling/releases/tag/v0.3.3. I fixed an issue when casting the mask value, but I don't know if it can fix your issue. I still cannot reproduce the issue on my machine, so it's best if you can provide more details:

nisanaryal-MTEG commented 1 year ago

@vietanhdev the problem is solved in the v0.3.3. Thanks for the hard work