sam-hq
sam-hq copied to clipboard
Input resolution - target size
Is there a way to control the input size? Do we need to enforce scaling the encoder expected resolution?
Hi, we follow SAM and using the input size 1024. If you want to change input size, please see the discussion here. Usually we suggest to resize your image to standard input size required by the model and then resize the predicted masks to any resolution you want.
Resizing it is not working well with large images with small targets.
https://github.com/SysCV/sam-hq/blob/ca530af6d6c8717e33704b07f4f3c6c8e778b0ff/segment_anything/predictor.py#LL31C26-L31C43
Skipping the resizing on ResizeLongestSide
it is working well instead but then the output mask is unaligned to the RGB source.
Can we make this more flexible?
Were you able to solve this issue? I want to resize the output masks back to original image shape and I'm not seeing where I should put this code
Not I still had that issue.
https://github.com/ByungKwanLee/Full-Segment-Anything addresses the ciritical issues of SAM, which supports batch-input on the full-grid prompt (automatic mask generation) with post-processing: removing duplicated or small regions and holes, under flexible input image size