Luodian / RelateAnything

Relate Anything Model is capable of taking an image as input and utilizing SAM to identify the corresponding mask within the image.
Apache License 2.0
438 stars 20 forks source link

Bug: thumbnail image resize #3

Open bofei5675 opened 1 year ago

bofei5675 commented 1 year ago

If you input image with clicked coordinates, I found the app throw an error. The error is caused by two masks has different size when computing IOU,.

It cause by the code in app.py:

# about line 161-165
w, h = pil_image.size
#if w > 800:
#    pil_image.thumbnail((800, 800*h/w))
#    input_image.thumbnail((800, 800*h/w))
#    coords = str(int(int(coords.split(',')[0]) * 800 / w)) + ',' + str(int(int(coords.split(',')[1]) * 800 / w))

comment thumbnail methods fix this issue but not sure I should do this.

Luodian commented 1 year ago

Indeed we found it could cause error previously (@Jingkang50), we will fix it soon!