(self, layer)
return {'mbox_prior': mbox_prior, 'mbox_loc': mbox_loc, 'mbox_conf': mbox_conf}
Given a key to the ssd_config, generate the leafs
Given a key to the ssd_config, generate the leafs
Given a key to the ssd_config generate the leafs
def generate_leafs(self, layer):
        """
        Given a key to the ssd_config, generate the leafs
        """
        config = self.ssd_config[layer]

        leaf_params = {'strides': 1,
                       'padding': 1,
                       'init': Xavier(local=True),
                       'bias': Constant(0)}

        # to match caffe layer's naming
        if config['normalize']:
            layer += '_norm'

        priorbox_args = self.get_priorbox_args(config)
        mbox_prior = PriorBox(**priorbox_args)
        num_priors = mbox_prior.num_priors_per_pixel

        loc_name = layer + '_mbox_loc'
        mbox_loc = Conv((3, 3, 4*num_priors), name=loc_name, **leaf_params)

        conf_name = layer + '_mbox_conf'
        mbox_conf = Conv((3, 3, self.num_classes*num_priors), name=conf_name, **leaf_params)

        return {'mbox_prior': mbox_prior, 'mbox_loc': mbox_loc, 'mbox_conf': mbox_conf}
def generate_leafs ( self , layer ) : config = self . ssd_config [ layer ] leaf_params = { 'strides' : 1 , 'padding' : 1 , 'init' : Xavier ( local = True ) , 'bias' : Constant ( 0 ) } # to match caffe layer's naming if config [ 'normalize' ] : layer += '_norm' priorbox_args = self . get_priorbox_args ( config ) mbox_prior = PriorBox ( * * priorbox_args ) num_priors = mbox_prior . num_priors_per_pixel loc_name = layer + '_mbox_loc' mbox_loc = Conv ( ( 3 , 3 , 4 * num_priors ) , name = loc_name , * * leaf_params ) conf_name = layer + '_mbox_conf' mbox_conf = Conv ( ( 3 , 3 , self . num_classes * num_priors ) , name = conf_name , * * leaf_params ) return { 'mbox_prior' : mbox_prior , 'mbox_loc' : mbox_loc , 'mbox_conf' : mbox_conf }