def __init__(self, num_layers=50):
   Network.__init__(self)
   self._feat_stride = [16, ]
   self._feat_compress = [1. / float(self._feat_stride[0]), ]
   self._num_layers = num_layers
   self._scope = 'resnet_v1_%d' % num_layers
   self._decide_blocks()
Example #2
0
 def __init__(self, num_layers=50):
   Network.__init__(self)
   self._feat_stride = [8, 8, 4]
   self._feat_compress = [1. / float(self._feat_stride[0]), ]
   self._num_layers = num_layers
   self._scope = 'resnet_3d_%d' % num_layers
   self._decide_blocks()
Example #3
0
 def __init__(self):
   Network.__init__(self)
   self._feat_stride = [16, ]
   self._feat_compress = [1. / float(self._feat_stride[0]), ]
   self._net_conv_channels = 514
   #self._net_conv_channels = 512
   self._fc7_channels = 4096
Example #4
0
 def __init__(self, num_layers=50):
     Network.__init__(self)
     self._feat_stride = cfg.ANCHOR_STRIDES
     self._feat_compress = [1. / float(self._feat_stride[0]), ]
     self._num_layers = num_layers
     self._scope = 'resnet_v1_%d' % num_layers
     self._decide_blocks()
Example #5
0
 def __init__(self, num_layers=50):
   Network.__init__(self)
   self._feat_stride = [16, ]
   self._feat_compress = [1. / float(self._feat_stride[0]), ]
   self._num_layers = num_layers
   self._net_conv_channels = 1024
   self._fc7_channels = 2048
Example #6
0
 def __init__(self, num_layers=50):
   Network.__init__(self)
   self._feat_stride = [16, ]
   self._feat_compress = [1. / float(self._feat_stride[0]), ]
   self._num_layers = num_layers
   self._net_conv_channels = 1024
   self._fc7_channels = 2048
 def __init__(self, num_layers=50):
     Network.__init__(self)
     if (cfg.USE_FPN):
         #WAS 4 now is 8 due to downsample layer after FPN
         if (cfg.POOLING_MODE == 'multiscale'):
             self._feat_stride = 4
         #DEPRECATED (see lidar for explanation)
         #else:
         #    self._feat_stride = 8
         self._fpn_en = True
         self._batchnorm_en = True
         self._net_conv_channels = 256
         self._roi_pooling_channels = cfg.POOLING_SIZE * cfg.POOLING_SIZE * self._net_conv_channels
     else:
         self._feat_stride = 16
         self._fpn_en = False
         self._batchnorm_en = True
         self._net_conv_channels = 1024
         self._roi_pooling_channels = 1024
     self._fc7_channels = 2048
     self.inplanes = 64
     self._num_resnet_layers = num_layers
     if (cfg.UC.EN_BBOX_EPISTEMIC or cfg.UC.EN_CLS_EPISTEMIC):
         self._det_net_channels = int(self._fc7_channels / 4)
         self._dropout_en = True
         self._cls_drop_rate = 0.3
         self._bbox_drop_rate = 0.1
         self._resnet_drop_rate = 0.5
     else:
         self._det_net_channels = self._fc7_channels
         self._dropout_en = False
         self._cls_drop_rate = 0.0
         self._bbox_drop_rate = 0.0
         self._resnet_drop_rate = 0.0
Example #8
0
 def _crop_pool_layer(self, bottom, rois):
     if cfg.FPN:
         return Network._crop_pool_layer_fpn(self, bottom, rois,
                                             cfg.RESNET.MAX_POOL)
     else:
         return Network._crop_pool_layer(self, bottom, rois,
                                         cfg.RESNET.MAX_POOL)
Example #9
0
 def __init__(self):
   Network.__init__(self)
   self._feat_stride = [16, ]
   self._feat_compress = [1. / float(self._feat_stride[0]), ]
   self._depth_multiplier = cfg.MOBILENET.DEPTH_MULTIPLIER
   self._net_conv_channels = 512
   self._fc7_channels = 1024
Example #10
0
 def __init__(self):
   Network.__init__(self)
   self._feat_stride = [16, ]
   self._feat_compress = [1. / float(self._feat_stride[0]), ]
   self._depth_multiplier = cfg.MOBILENET.DEPTH_MULTIPLIER
   self._net_conv_channels = 512
   self._fc7_channels = 1024
Example #11
0
 def __init__(self, num_layers=50):
     Network.__init__(self)
     self._feat_stride = [
         16,
     ]
     self._num_layers = num_layers
     self._scope = 'resnet_v1_%d' % num_layers
     self._decide_blocks()
Example #12
0
 def __init__(self):
   Network.__init__(self)
   if cfg.REMOVE_POOLING:
     self._feat_stride = [8, ]
   else:
     self._feat_stride = [16, ]
   self._feat_compress = [1. / float(self._feat_stride[0]), ]
   self._scope = 'vgg_16'
Example #13
0
 def __init__(self):
     Network.__init__(self)
     self._feat_stride = [
         16,
     ]
     self._feat_compress = [
         1. / float(self._feat_stride[0]),
     ]
     self._scope = 'vgg_16'
 def __init__(self):
     Network.__init__(self)
     self._feat_stride = [
         16,
     ]
     self._feat_compress = [
         1. / float(self._feat_stride[0]),
     ]
     self._net_conv_channels = cfg.FC6_IN_CHANNEL
     self._fc7_channels = cfg.FC7_OUT_CHANNEL
 def __init__(self):
     Network.__init__(self)
     self._feat_stride = [
         16,
     ]
     self._feat_compress = [
         1. / float(self._feat_stride[0]),
     ]
     self._depth_multiplier = cfg.MOBILENET.DEPTH_MULTIPLIER
     self._scope = 'MobilenetV1'
Example #16
0
 def __init__(self, batch_size=1, num_layers=50):
   Network.__init__(self, batch_size=batch_size)
   self._predictions = {i: {} for i in range(5, 1, -1)}
   self._anchor_targets = {i: {} for i in range(5, 1, -1)}
   self._proposal_targets = {i: {} for i in range(5, 1, -1)}
   self._num_layers = num_layers
   self._arch = 'res_v1_%d' % num_layers
   self._resnet_scope = 'resnet_v1_%d' % num_layers
   
   self._feat_stride = {}
Example #17
0
 def __init__(self):
     Network.__init__(self)
     self._feat_stride = [
         16,
     ]
     self._feat_compress = [
         1. / float(self._feat_stride[0]),
     ]
     self._m = ConvNet(seed=0)
     self._scope = 'alexnet_tf'
Example #18
0
 def __init__(self):
     Network.__init__(self)
     self._feat_stride = [
         16,
     ]
     self._feat_compress = [
         1. / float(self._feat_stride[0]),
     ]
     self._net_conv_channels = 512
     self._fc7_channels = 4096
Example #19
0
 def __init__(self, num_layers=50):
     Network.__init__(self)
     self._feat_stride = [
         16,
     ]
     self._feat_compress = [
         1. / float(self._feat_stride[0]),
     ]
     self._num_layers = num_layers
     self.resnet_constructor = ImagenetModel(num_layers)
     self._scope = 'resnet_model'
Example #20
0
    def __init__(self):
        Network.__init__(self)

        # [Hand Detection --> change to 4]
        self._feat_stride = [
            4,
        ]
        self._feat_compress = [
            1. / float(self._feat_stride[0]),
        ]
        self._scope = 'vgg_16'
 def __init__(self, num_layers=41):
     Network.__init__(self)
     self._feat_stride = [
         16,
     ]
     self._feat_compress = [
         1. / float(self._feat_stride[0]),
     ]
     self._num_layers = num_layers
     self._scope = 'resnet_v1_50'
     self._decide_blocks()
Example #22
0
 def __init__(self):
     Network.__init__(self)
     # config which branch contained in the SSH -- should be the format of ['M1', 'M2', 'M3']
     self._feat_branches = ['M1', 'M2', 'M3']
     self._Module_boxes = {'M1': 128, 'M2': 256, 'M3': 256}
     self._feat_stride = {"M1": 8, 'M2': 16, 'M3': 32}
     self._feat_layers = {
         "M1": ['conv4_3', 'conv5_3'],
         'M2': 'conv5_3',
         'M3': 'conv5_3'
     }
     self._scope = 'vgg_16'
     self.end_points = {}
Example #23
0
 def __init__(self, nof_ent_classes, nof_rel_classes, num_layers=50):
     Network.__init__(self)
     self._feat_stride = [
         16,
     ]
     self._feat_compress = [
         1. / float(self._feat_stride[0]),
     ]
     self._num_layers = num_layers
     self._scope = 'resnet_v1_%d' % num_layers
     self._decide_blocks()
     self.nof_ent_classes = nof_ent_classes
     self.nof_rel_classes = nof_rel_classes
Example #24
0
 def __init__(self, darknet53_npz_path=None):
     Network.__init__(self)
     self._feat_branches = {'M1', 'M2', 'M3'}
     self._feat_stride = {'M1': 8, 'M2': 16, 'M3': 32}
     self._feat_layers = {
         'M1': ['res10', 'res18'],
         'M2': 'res18',
         'M3': 'res22'
     }
     self._Module_boxes = {'M1': 128, 'M2': 256, 'M3': 256}
     self.end_points = {}
     self._scope = 'Darknet53'
     self.darknet53_npz_path = darknet53_npz_path
Example #25
0
 def __init__(self):
     Network.__init__(self)
     # config which branch contained in the SSH  should be the format of ['M1', 'M2', 'M3']
     self._feat_branches = ['M1', 'M2', 'M3']
     self._feat_stride = {'M1': 8, 'M2': 16, 'M3': 32}
     self._Module_boxes = {'M1': 128, 'M2': 256, 'M3': 256}
     self._feat_layers = {
         'M1': ['Conv2d_5_pointwise', 'Conv2d_13_pointwise'],
         'M2': 'Conv2d_13_pointwise',
         'M3': 'Conv2d_13_pointwise'
     }
     self.end_points = {}
     self._depth_multiplier = cfg.MOBILENET.DEPTH_MULTIPLIER
     self._scope = 'MobilenetV1'
Example #26
0
	def __init__(self, key="gpu"):
		Network.__init__(self)
		self.mobilenet, self.urls = nasnet(pretrained=False, key=key)

		self._feat_stride = [16, ]
		self._feat_compress = [1. / float(self._feat_stride[0]), ]
		self._depth_multiplier = cfg.MOBILENET.DEPTH_MULTIPLIER
		self._net_conv_channels = 320
		self._fc7_channels = 1280
		self._net_conv_channels = self.mobilenet.feature_mix_layer.in_channels
		self._fc7_channels = self.mobilenet.feature_mix_layer.in_channels * 4 # out_channels?

		if key == "cpu":
			self._net_conv_channels =  self.mobilenet.feature_mix_layer.in_channels
			self._fc7_channels =  self.mobilenet.feature_mix_layer.out_channels
Example #27
0
 def __init__(self, num_layers=50):
     Network.__init__(self)
     if cfg.FPN:
         self._feat_stride = [4, 8, 16, 32, 64]
         self._net_conv_channels = 256
         self._fc7_channels = 1024
     else:
         self._feat_stride = [
             16,
         ]
         self._net_conv_channels = 1024
         self._fc7_channels = 2048
     self._feat_compress = [
         1. / float(self._feat_stride[0]),
     ]
     self._num_layers = num_layers
Example #28
0
 def __init__(self, num_layers=50):
     Network.__init__(self)
     # config which branch contained in the SSH  should be the format of ['M1', 'M2', 'M3']
     self._feat_branches = ['M1', 'M2', 'M3']
     self._feat_stride = {'M1': 8, 'M2': 16, 'M3': 32}
     self._Module_boxes = {'M1': 128, 'M2': 256, 'M3': 256}
     # self._feat_layers = {'M1': ['block2', 'block3'], 'M2': 'block3', 'M3': 'block3'}
     self._feat_layers = {
         'M1': ['block2', 'block4'],
         'M2': 'block4',
         'M3': 'block4'
     }
     self.end_points = {}
     self._num_layers = num_layers
     self._scope = 'resnet_v1_%d' % num_layers
     self._decide_blocks()
Example #29
0
 def __init__(self):
     Network.__init__(self)
     # config which branch contained in the SSH  should be the format of ['M1', 'M2', 'M3']
     self._feat_branches = ['M1', 'M2', 'M3']
     self._feat_stride = {'M1': 8, 'M2': 16, 'M3': 32}
     self._feat_layers = {
         'M1': ['layer_5', 'layer_14'],
         'M2': 'layer_14',
         'M3': 'layer_19'
     }
     # self._feat_layers = {'M1': ['layer_5/expansion_output', 'layer_19'], 'M2': 'layer_19',
     #                      'M3': 'layer_19'}
     self._Module_boxes = {'M1': 128, 'M2': 256, 'M3': 256}
     self.end_points = {}
     self._depth_multiplier = cfg.MOBILENET_V2.DEPTH_MULTIPLIER
     self._min_depth = cfg.MOBILENET_V2.MIN_DEPTH
     self._scope = 'MobilenetV2'
Example #30
0
    def __init__(self, opt, batch_size=1, num_layers=50):
        Network.__init__(self, batch_size=batch_size)
        self._num_layers = num_layers

        # language rnn encoder
        self.rnn_encoder = RNNEncoder(
            vocab_size=opt['vocab_size'],
            word_embedding_size=opt['word_embedding_size'],
            word_vec_size=opt['word_vec_size'],
            hidden_size=opt['rnn_hidden_size'],
            bidirectional=opt['bidirectional'] > 0,
            input_dropout_p=opt['word_drop_out'],
            dropout_p=opt['rnn_drop_out'],
            n_layers=opt['rnn_num_layers'],
            rnn_type=opt['rnn_type'],
            variable_lengths=opt['variable_lengths'] > 0)

        self._rnn_num_layers = opt['rnn_num_layers']
        self._rnn_hidden_size = opt['rnn_hidden_size']
        self._rnn_num_dirs = 2 if opt['bidirectional'] > 0 else 1
        self._C4_feat_dim = opt['C4_feat_dim']
Example #31
0
 def __init__(self, num_layers=50):
     Network.__init__(self)
     if(cfg.USE_FPN):
         if(cfg.POOLING_MODE == 'multiscale'):
             self._feat_stride     = 4
         #DEPRECATED, only do multiscale pooling now
         #else:
         #    self._feat_stride     = 8
         self._fpn_en               = True
         self._batchnorm_en         = True
         self._net_conv_channels    = 256
         self._roi_pooling_channels = cfg.POOLING_SIZE*cfg.POOLING_SIZE*self._net_conv_channels
     elif(cfg.USE_LIDAR_FPN):
         self._feat_stride          = 8
         self._fpn_en               = True
         self._batchnorm_en         = False
         self._net_conv_channels    = 1024
         self._roi_pooling_channels = cfg.POOLING_SIZE*cfg.POOLING_SIZE*self._net_conv_channels
     else:
         self._feat_stride          = 16
         self._fpn_en               = False
         self._net_conv_channels    = 1024
         self._roi_pooling_channels = 1024
         self._batchnorm_en         = False
     self._fc7_channels      = 2048
     self.inplanes           = 64
     self._num_resnet_layers = num_layers
     if(cfg.UC.EN_BBOX_EPISTEMIC or cfg.UC.EN_CLS_EPISTEMIC):
         self._det_net_channels = int(self._fc7_channels/4)
         self._dropout_en       = True
         self._resnet_drop_rate = 0.5
         self._cls_drop_rate    = 0.2
         self._bbox_drop_rate   = 0.5
     else:
         self._det_net_channels = self._fc7_channels
         self._dropout_en       = False
         self._resnet_drop_rate = 0.0
         self._cls_drop_rate    = 0.0
         self._bbox_drop_rate   = 0.0
     self.num_lidar_channels = cfg.LIDAR.NUM_CHANNEL
Example #32
0
 def __init__(self, batch_size=1, num_layers=50):
     Network.__init__(self, batch_size=batch_size)
     self._num_layers = num_layers
     self._resnet_scope = 'resnet_v1_%d' % num_layers
Example #33
0
 def __init__(self):
     Network.__init__(self)
     self._feat_stride = [16, ]
     self._scope = 'mobilenet_v2'
Example #34
0
 def __init__(self):
   Network.__init__(self)
   self._feat_stride = [16, ]
   self._feat_compress = [1. / float(self._feat_stride[0]), ]
   self._scope = 'vgg_16'
Example #35
0
 def __init__(self, batch_size=1):
   Network.__init__(self, batch_size=batch_size)
   self._depth_multiplier = cfg.MOBILENET.DEPTH_MULTIPLIER
   self._scope = 'MobilenetV1'
Example #36
0
 def __init__(self, batch_size=1):
   Network.__init__(self, batch_size=batch_size)
 def __init__(self, batch_size=1, num_layers=50):
   Network.__init__(self, batch_size=batch_size)
   self._num_layers = num_layers
   self._resnet_scope = 'resnet_v1_%d' % num_layers
Example #38
0
 def __init__(self, batch_size=1, num_layers=50):
     Network.__init__(self, batch_size=batch_size)
     self._num_layers = num_layers
     self._resnet_scope = 'resnet_v1_%d' % num_layers
     self.bottleneck_func = resnet_v1.bottleneck
     self._end_points_collection = self._resnet_scope + '_end_points'
Example #39
0
 def __init__(self):
     Network.__init__(self)
     self._feat_stride = [16, ]
     self._scope = 'vgg_16'
Example #40
0
 def _crop_pool_layer(self, bottom, rois):
   return Network._crop_pool_layer(self, bottom, rois, cfg.RESNET.MAX_POOL)
 def __init__(self):
   Network.__init__(self)
   self._feat_stride = [16, ]
   self._feat_compress = [1. / float(self._feat_stride[0]), ]
   self._depth_multiplier = cfg.MOBILENET.DEPTH_MULTIPLIER
   self._scope = 'MobilenetV1'
Example #42
0
 def __init__(self, with_dropout=False):
   Network.__init__(self)
   self._feat_stride = [16, ]
   self._feat_compress = [1. / float(self._feat_stride[0]), ]
   self._scope = 'alexnet_v2'
   self.with_dropout = with_dropout
Example #43
0
 def __init__(self, batch_size=1):
   Network.__init__(self, batch_size=batch_size)
   self._arch = 'res101'