예제 #1
0
파일: vision.py 프로젝트: zycanfly/Dragon
 def Setup(self, bottom):
     super(NNResizeLayer, self).Setup(bottom)
     input = bottom[0] if isinstance(bottom, list) else bottom
     if isinstance(bottom, list) and len(bottom) > 1:
         dshape = ops.Shape(bottom[1])
         self._param['dsize'] = (dshape[2], dshape[3])
     return ops.NNResize(input, **self._param)
예제 #2
0
파일: vision.py 프로젝트: Spark001/Dragon-1
 def Setup(self, bottom):
     super(NNResizeLayer, self).Setup(bottom)
     input = bottom[0] if isinstance(bottom, list) else bottom
     if self._param['dsize'] is None:
         if len(bottom) != 2:
             raise ValueError('The second bottom should be provided to determine the shape.')
         self._param['shape_like'] = bottom[1]
     return ops.NNResize(input, **self._param)
예제 #3
0
 def LayerSetup(self, bottom):
     if self.arguments['dsize'] is None:
         if not isinstance(bottom, (tuple, list)) or len(bottom) != 2:
             raise ValueError(
                 'The second bottom should be provided to determine the shape.'
             )
         self.arguments['shape_like'] = bottom[1]
         bottom = bottom[0]
     return _ops.NNResize(bottom, **self.arguments)
예제 #4
0
 def Setup(self, bottom):
     super(NNResizeLayer, self).Setup(bottom)
     input = bottom[0] if isinstance(bottom, list) else bottom
     return ops.NNResize(input, **self._param)