示例#1
0
	def initialize(self):
		self.bn0 = M.BatchNorm()
		self.c1 = M.ConvLayer(7, 64, stride=2, activation=M.PARAM_RELU, batch_norm=True, usebias=False)
		self.pool = M.MaxPool2D(3, 2)
		self.stage1 = Stage(64, num_units=3, stride=1)
		self.stage2 = Stage(128, num_units=4, stride=2)
		self.stage3 = Stage(256, num_units=6, stride=2)
		self.stage4 = Stage(512, num_units=3, stride=2)
		self.bn1 = M.BatchNorm()
		self.act = M.Activation(M.PARAM_RELU)

		self.ssh_c3_lateral = M.ConvLayer(1, 256, batch_norm=True, activation=M.PARAM_RELU)
		self.det3 = DETHead()
		self.head32 = RegressHead()

		self.ssh_c2_lateral = M.ConvLayer(1, 256, batch_norm=True, activation=M.PARAM_RELU)
		self.ssh_c3_upsampling = M.NNUpSample(2)
		self.ssh_c2_aggr = M.ConvLayer(3, 256, batch_norm=True, activation=M.PARAM_RELU)
		self.det2 = DETHead()
		self.head16 = RegressHead()

		self.ssh_m1_red_conv = M.ConvLayer(1, 256, batch_norm=True, activation=M.PARAM_RELU)
		self.ssh_c2_upsampling = M.NNUpSample(2)
		self.ssh_c1_aggr = M.ConvLayer(3, 256, batch_norm=True, activation=M.PARAM_RELU)
		self.det1 = DETHead()
		self.head8 = RegressHead()
示例#2
0
    def initialize(self):
        self.c1 = M.ConvLayer(3,
                              8,
                              stride=2,
                              usebias=False,
                              batch_norm=True,
                              activation=M.PARAM_RELU)
        self.c2 = M.DWConvLayer(3,
                                1,
                                usebias=False,
                                batch_norm=True,
                                activation=M.PARAM_RELU)
        self.c3 = M.ConvLayer(1,
                              16,
                              usebias=False,
                              batch_norm=True,
                              activation=M.PARAM_RELU)
        self.c4 = M.DWConvLayer(3,
                                1,
                                stride=2,
                                usebias=False,
                                batch_norm=True,
                                activation=M.PARAM_RELU)
        self.c5 = M.ConvLayer(1,
                              32,
                              usebias=False,
                              batch_norm=True,
                              activation=M.PARAM_RELU)
        self.c6 = M.DWConvLayer(3,
                                1,
                                usebias=False,
                                batch_norm=True,
                                activation=M.PARAM_RELU)
        self.c7 = M.ConvLayer(1,
                              32,
                              usebias=False,
                              batch_norm=True,
                              activation=M.PARAM_RELU)
        self.c8 = M.DWConvLayer(3,
                                1,
                                stride=2,
                                usebias=False,
                                batch_norm=True,
                                activation=M.PARAM_RELU)
        self.c9 = M.ConvLayer(1,
                              64,
                              usebias=False,
                              batch_norm=True,
                              activation=M.PARAM_RELU)
        self.c10 = M.DWConvLayer(3,
                                 1,
                                 usebias=False,
                                 batch_norm=True,
                                 activation=M.PARAM_RELU)
        self.c11 = M.ConvLayer(1,
                               64,
                               usebias=False,
                               batch_norm=True,
                               activation=M.PARAM_RELU)

        self.c12 = M.DWConvLayer(3,
                                 1,
                                 stride=2,
                                 usebias=False,
                                 batch_norm=True,
                                 activation=M.PARAM_RELU)
        self.c13 = M.ConvLayer(1,
                               128,
                               usebias=False,
                               batch_norm=True,
                               activation=M.PARAM_RELU)
        self.c14 = M.DWConvLayer(3,
                                 1,
                                 usebias=False,
                                 batch_norm=True,
                                 activation=M.PARAM_RELU)
        self.c15 = M.ConvLayer(1,
                               128,
                               usebias=False,
                               batch_norm=True,
                               activation=M.PARAM_RELU)
        self.c16 = M.DWConvLayer(3,
                                 1,
                                 usebias=False,
                                 batch_norm=True,
                                 activation=M.PARAM_RELU)
        self.c17 = M.ConvLayer(1,
                               128,
                               usebias=False,
                               batch_norm=True,
                               activation=M.PARAM_RELU)
        self.c18 = M.DWConvLayer(3,
                                 1,
                                 usebias=False,
                                 batch_norm=True,
                                 activation=M.PARAM_RELU)
        self.c19 = M.ConvLayer(1,
                               128,
                               usebias=False,
                               batch_norm=True,
                               activation=M.PARAM_RELU)
        self.c20 = M.DWConvLayer(3,
                                 1,
                                 usebias=False,
                                 batch_norm=True,
                                 activation=M.PARAM_RELU)
        self.c21 = M.ConvLayer(1,
                               128,
                               usebias=False,
                               batch_norm=True,
                               activation=M.PARAM_RELU)
        self.c22 = M.DWConvLayer(3,
                                 1,
                                 usebias=False,
                                 batch_norm=True,
                                 activation=M.PARAM_RELU)
        self.c23 = M.ConvLayer(1,
                               128,
                               usebias=False,
                               batch_norm=True,
                               activation=M.PARAM_RELU)

        self.c24 = M.DWConvLayer(3,
                                 1,
                                 stride=2,
                                 usebias=False,
                                 batch_norm=True,
                                 activation=M.PARAM_RELU)
        self.c25 = M.ConvLayer(1,
                               256,
                               usebias=False,
                               batch_norm=True,
                               activation=M.PARAM_RELU)
        self.c26 = M.DWConvLayer(3,
                                 1,
                                 usebias=False,
                                 batch_norm=True,
                                 activation=M.PARAM_RELU)
        self.c27 = M.ConvLayer(1,
                               256,
                               usebias=False,
                               batch_norm=True,
                               activation=M.PARAM_RELU)
        self.bn_eps(1e-5)

        self.rf_c3_lateral = M.ConvLayer(1,
                                         64,
                                         batch_norm=True,
                                         activation=M.PARAM_RELU)
        self.rf_c3_lateral.bn_eps(2e-5)
        self.det3 = DETHead()
        self.det3.bn_eps(2e-5)

        self.rf_c2_lateral = M.ConvLayer(1,
                                         64,
                                         batch_norm=True,
                                         activation=M.PARAM_RELU)
        self.rf_c2_lateral.bn_eps(2e-5)
        self.rf_c3_upsampling = M.NNUpSample(2)
        self.rf_c2_aggr = M.ConvLayer(3,
                                      64,
                                      batch_norm=True,
                                      activation=M.PARAM_RELU)
        self.rf_c2_aggr.bn_eps(2e-5)
        self.det2 = DETHead()
        self.det2.bn_eps(2e-5)

        self.rf_c1_red_conv = M.ConvLayer(1,
                                          64,
                                          batch_norm=True,
                                          activation=M.PARAM_RELU)
        self.rf_c1_red_conv.bn_eps(2e-5)
        self.rf_c2_upsampling = M.NNUpSample(2)
        self.rf_c1_aggr = M.ConvLayer(3,
                                      64,
                                      batch_norm=True,
                                      activation=M.PARAM_RELU)
        self.rf_c1_aggr.bn_eps(2e-5)
        self.det1 = DETHead()
        self.det1.bn_eps(2e-5)

        self.head32 = RegressHead()
        self.head16 = RegressHead()
        self.head8 = RegressHead()