mmsegmentation icon indicating copy to clipboard operation
mmsegmentation copied to clipboard

Is there any way to receive a test image, keeping its original size?

Open cheul0518 opened this issue 3 years ago • 2 comments

I have a model that segments images in the slide mode. The model first reduces the size of a receiving image and then predicts its mask by sliding in a fixed size. Since this model's using slide mode, I no longer feel to reduce the size of a receiving image, because the model's able to slide a image and predict its mask regardless how big it is. So, I tried to train a model without img_scale in MultiScaleFlipAug. It didn't work. I set instead img_ratios=1 but it didn't work either without setting img_scale. Is there any other way to not specifically set the size of a receiving image and to train the model?

cheul0518 avatar Aug 24 '22 06:08 cheul0518

Please try to replace MultiScaleFlipAug with Normalization in test_pipeline https://github.com/open-mmlab/mmsegmentation/blob/dd42fa8d0125632371a41a87c20485494c973535/configs/base/datasets/ade20k.py#L21-L32 https://github.com/open-mmlab/mmsegmentation/blob/dd42fa8d0125632371a41a87c20485494c973535/configs/base/datasets/ade20k.py#L14

MeowZheng avatar Aug 25 '22 15:08 MeowZheng

@MeowZheng, thank you for your comment. But I think I was unclear about what I was asking. I was looking for any alternative way to avoid declaring the specific size of the input image in MultiScaleFlipAug in order to predict the unknown size of the input image. For example, img_scale=(2048,512) in MultiScaleFlipAug in your example. I would like not to explicitly define the img_scale of the test input image because the test image size in my dataset varies from (500,500) to (3000,3000). I already looked up the source code of MultiScaleFlipAug but there seemed no way to set img_scale to random. So I was asking for any alternative way to deal with the random size of an input image.

cheul0518 avatar Aug 26 '22 07:08 cheul0518

i met the same problem, have you solved it?

wzr0108 avatar Dec 18 '22 05:12 wzr0108

For the task that consists of randomly sized images, no I didn't find the way to keep the input image size as it is in mmsegmentation setting. However, I tested them (original size v. resize) in manually coded models and there was no difference (sometimes resized images worked better). Hope it helps.

On Sun, Dec 18, 2022 at 2:27 PM wzr0108 @.***> wrote:

i met the same problem, have you solved it?

— Reply to this email directly, view it on GitHub https://github.com/open-mmlab/mmsegmentation/issues/1963#issuecomment-1356677244, or unsubscribe https://github.com/notifications/unsubscribe-auth/AISIRWKRA5NRFQ4227CNBJLWN2OERANCNFSM57N7MOLA . You are receiving this because you authored the thread.Message ID: @.***>

cheul0518 avatar Dec 19 '22 02:12 cheul0518