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

Created on 28 Jun 2017  Â·  14Comments  Â·  Source: tensorflow/models

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.

Most helpful comment

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.

All 14 comments

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 I understand now , I admire you very much .

closing as the question was addressed.

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

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

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.

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?

+1

@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?

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

@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 Thanks

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

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?

Was this page helpful?
0 / 5 - 0 ratings