Micah Price
Micah Price

Reputation: 153

Is Tensorflow Object Detection Aspect Ratio height/width or width/height?

I'm playing around with Tensorflow's Object Detection models and want to provide my own custom aspect ratios. In the config file it could look something like this:

    anchor_generator {
      ssd_anchor_generator {
        num_layers: 4
        min_scale: 0.2
        max_scale: 0.95
        aspect_ratios: 1.0
        aspect_ratios: .5
        aspect_ratios: 2.
        aspect_ratios: 10.0
        reduce_boxes_in_lowest_layer: true
      }

Digging through the source code, it isn't obvious to me whether the aspect ratio is defined as height/width or width/height. I assumed that it's width/height (so 10 would have w:h of 10:1) but if I'm wrong I know my model will train very poorly!

Upvotes: 2

Views: 1515

Answers (2)

Ehab Medhat
Ehab Medhat

Reputation: 1

due to opencv doc
aspect ratio = width / height
check this link.

Upvotes: -1

Menglong Zhu
Menglong Zhu

Reputation: 126

Our conversion in the codebase is: aspect_ratio = width/height, which follows the general definition of aspect ratio: https://en.wikipedia.org/wiki/Aspect_ratio_(image).

Upvotes: 3

Related Questions