smartwell opened a new issue #14679: when convert caffe SSD to MXNET, how to 
deal repeated min_size
URL: https://github.com/apache/incubator-mxnet/issues/14679
 
 
    First, thanks for the great work.
   
   Recently,ShiqiYu group release facedetect.caffemodel, so i want to convert 
this model to mxnet, i use @zhreshold [tools 
caffe_converter](https://github.com/zhreshold/mxnet-ssd), normally, every 
priorbox layer has one min_size and one max_size,  when we try vgg_ssd or 
mobilenet_ssd ,they all work. But in this facedetect caffe prototxt ,every 
priorbox layer has mulit min_size and no max_size , but this convert code can't 
to do this work ,i try many many times to  convert this caffe model , have no 
idea, so i holp some one can help me。
   ### API mx.contrib.symbol.MultiBoxPrior   how to deal with caffe priorbox 
with repeated  min_size
   
   # if layer[i].type == 'PriorBox':
           param = layer[i].prior_box_param
           if layer[i].bottom[0] == 'data':
               bottom_order = [1]
           else:
               bottom_order = [0]
          
          # i change your code ,there  is no  max_size, so i do like below
           num_min_size_size = len(param.min_size)
           num_max_size_size = len(param.max_size)
           if num_max_size_size >0:
               assert num_max_size_size==num_min_size_size
           sizes_list =[]
           for min_size in param.min_size:
               sizes_list.append(min_size / input_dim[2])
           sizes = "(" + ",".join([str(x) for x in sizes_list]) + ")"
           
           # try:
           #     min_size = param.min_size[0] / input_dim[2]
           #     max_size = math.sqrt(param.min_size[0] * param.max_size[0]) / 
input_dim[2]
           #     sizes = '(%f, %f)' %(min_size, max_size)
           # except Exception as e:
           #     print(e)
           #     min_size = param.min_size[0] / input_dim[2]
           #     sizes = '(%f)' %(min_size)
   
          priorbox_name_list = []
           for index_size in range(len(sizes_list)):
               size = '(%f)' %(sizes_list[index_size])
               symbol_string += '%s = mx.contrib.symbol.MultiBoxPrior(%s, 
sizes=%s, ratios=%s, clip=%s, steps=%s, name="%s")\n' % \
                                (name + '_' + str(index_size), 
mapping[layer[i].bottom[0]], size, ratios_string, clip, step, name+'_' + 
str(index_size))
               priorbox_name_list.append(name + '_' + str(index_size))
           symbol_string += "%s = mx.symbol.Concat(name = '%s', 
*[%s])\n"%(name, name, ','.join(priorbox_name_list))
   yes,don't need to run, just decide if I'm wrong, In a priorbox layer, for 
every min_size, i do once time mx.contrib.symbol.MultiBoxPrior, and than Concat 
these MultiBoxPrior together, it also dosen't work
   
   Looking forward to your reply, thanks again

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to