ByungKwanLee / Full-Segment-Anything

This is Pytorch Implementation Code for adding new features in code of Segment-Anything. Here, the features support 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
MIT License
121 stars 9 forks source link

Not square images #7

Open mariiak2021 opened 2 months ago

mariiak2021 commented 2 months ago

Hi @ByungKwanLee

I was wondering if your code supports images of any (even not square) resolutions? I have a dataset of images of very different in size and resolution images (e.g. average: 1200x310, biggest resolution: (1323, 321), Smallest Resolution: (539, 260)). Can I train my model using your code for this type of data?

Which places in the code should i check to understand how is it handled better?

Thanx!

ByungKwanLee commented 2 months ago

If you want to input non-square image, then you should check the part where you should search with 'lbk'

image

When you search, there may be eight parts.

Due to my current paper working, I cannot now check the parts myself, I am really sorry.

mariiak2021 commented 2 months ago

Hi @ByungKwanLee thank you for your fast reply! Sorry, can you please clarify for me: is non-square input already implemented in your code or I need to make additional changes to the parts marked as 'lbk'?

ByungKwanLee commented 2 months ago

I thought it was not implemented due to SAM's original implementation for none of non-square inputs :(

mariiak2021 commented 1 month ago

Hi @ByungKwanLee sorry I still don't understand :) Can you please tell me which parts of the code should I check and change to be able to use non-square image inputs?