rykov8 / ssd_keras

Port of Single Shot MultiBox Detector to Keras
MIT License
1.1k stars 551 forks source link

Why aspect_ratios is not equal to num_priors? #103

Open shuuchen opened 7 years ago

shuuchen commented 7 years ago

Hi All, I am reading the code to understand it better. I find that in ssd.py, there is only one element in the aspect_ratios list while num_priors is 3. Shouldn't that be equal?

138     num_priors = 3
...
152     priorbox = PriorBox(img_size, 30.0, aspect_ratios=[2],
153                         variances=[0.1, 0.1, 0.2, 0.2],
154                         name='conv4_3_norm_mbox_priorbox')

For that in ssd_layers.py, numpriors is equal to the length of aspect_ratios list.

112         num_priors_ = len(self.aspect_ratios)

Can someone explain this?

JordanPeltier commented 7 years ago

aspect_ratios = [2] with Max_size set to None means you will have the ratios 1.0, 2.0 and 1/2.0. So actually you will have 3 priors