models icon indicating copy to clipboard operation
models copied to clipboard

what the field "keep_aspect_ratio_resizer" means in the .config file?

Open wangxiaopeng0329 opened this issue 9 years ago • 14 comments

model { faster_rcnn { num_classes: 37 image_resizer { keep_aspect_ratio_resizer { min_dimension: 600 max_dimension: 1024 } } feature_extractor { type: 'faster_rcnn_resnet101' first_stage_features_stride: 16 }

on the above,what the min_dimension or max_dimension represents ? Please interprete it ,thank you very much.

wangxiaopeng0329 avatar Jun 28 '17 06:06 wangxiaopeng0329

Hi @wxp0329 - Specifying the keep_aspect_ratio_resizer follows the image resizing scheme described in the Faster R-CNN paper. In this case it always resizes an image so that the smaller edge is 600 pixels and if the longer edge is greater than 1024 edges, it resizes such that the longer edge is 1024 pixels. The resulting image always has the same aspect ratio as the input image.

jch1 avatar Jun 28 '17 06:06 jch1

@jch1 I understand now , I admire you very much .

wangxiaopeng0329 avatar Jun 28 '17 07:06 wangxiaopeng0329

closing as the question was addressed.

tombstone avatar Jun 28 '17 16:06 tombstone

@wxp0329 @jch1 Can this network takes any size of image with in above mentioned limits ?

shamanez avatar Jul 24 '17 20:07 shamanez

So would it be okay for images to be bigger than this size?

mikeliao97 avatar Nov 04 '17 20:11 mikeliao97

Does it have anything to do with the annotations? i.e, do the annotations get disturbed because of this? because my dataset has images of 1080x1920 resolution and resizing it to 600 and 1024 is okay?

sorry if the question is silly. this is a newbie.

srinath-ramachandran avatar Nov 08 '17 09:11 srinath-ramachandran

Hi sxr3455 , did you figure this out? I have the same query and was not able to find anything. @jch1 Any inputs on what happens to the annotations during resize ? If the image is resized and the annotations remain unchanged, will it not lead to incorrect inputs?

SMS786 avatar Jul 17 '18 07:07 SMS786

+1

leccyril avatar Jul 26 '18 13:07 leccyril

@jch1 Hi,I want to make sure if my input image is 640 x 352 ,then after image_resizer will the input image still be 640 x 352?

swg209 avatar Sep 19 '18 09:09 swg209

Hi @SMS786, @sxr3455 did you guys find answer to that questions? What happens to bounding boxes/masks in case of resizing?

amin07 avatar Oct 03 '18 06:10 amin07

@amin07 The bounding box coordinates are normalised to the range [0 .. 1], so resizing the images won't affect those annotations.

EDIT: Masks are resized or otherwise transformed along with the image, and always have the same dimensions as the image.

tasercake avatar Oct 25 '18 06:10 tasercake

@tasercake Thanks

amin07 avatar Oct 25 '18 22:10 amin07

hi, just to clarify with min=600 and max=800 the CNN input size is then 800x800 square, right?

Borda avatar Feb 27 '20 11:02 Borda

I just wanna know if I use keep_aspect_ratio_resizer in .config file , it means I will resize the input images to same aspect ratio but not a fixed shape like 224*224 , right?

natures66 avatar Apr 20 '20 14:04 natures66