當前位置: 首頁>>代碼示例>>Python>>正文


Python resnet.StageSpec方法代碼示例

本文整理匯總了Python中maskrcnn_benchmark.modeling.backbone.resnet.StageSpec方法的典型用法代碼示例。如果您正苦於以下問題:Python resnet.StageSpec方法的具體用法?Python resnet.StageSpec怎麽用?Python resnet.StageSpec使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在maskrcnn_benchmark.modeling.backbone.resnet的用法示例。


在下文中一共展示了resnet.StageSpec方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from maskrcnn_benchmark.modeling.backbone import resnet [as 別名]
# 或者: from maskrcnn_benchmark.modeling.backbone.resnet import StageSpec [as 別名]
def __init__(self, config):
        super(ResNet50Conv5ROIFeatureExtractor, self).__init__()

        resolution = config.MODEL.ROI_BOX_HEAD.POOLER_RESOLUTION
        scales = config.MODEL.ROI_BOX_HEAD.POOLER_SCALES
        sampling_ratio = config.MODEL.ROI_BOX_HEAD.POOLER_SAMPLING_RATIO
        pooler = PyramidRROIAlign(
            output_size=(resolution, resolution),
            scales=scales,
        )

        stage = resnet.StageSpec(index=4, block_count=3, return_features=False)
        head = resnet.ResNetHead(
            block_module=config.MODEL.RESNETS.TRANS_FUNC,
            stages=(stage,),
            num_groups=config.MODEL.RESNETS.NUM_GROUPS,
            width_per_group=config.MODEL.RESNETS.WIDTH_PER_GROUP,
            stride_in_1x1=config.MODEL.RESNETS.STRIDE_IN_1X1,
            stride_init=None,
            res2_out_channels=config.MODEL.RESNETS.RES2_OUT_CHANNELS,
            dilation=config.MODEL.RESNETS.RES5_DILATION
        )

        self.pooler = pooler
        self.head = head 
開發者ID:clw5180,項目名稱:remote_sensing_object_detection_2019,代碼行數:27,代碼來源:roi_box_feature_extractors.py

示例2: __init__

# 需要導入模塊: from maskrcnn_benchmark.modeling.backbone import resnet [as 別名]
# 或者: from maskrcnn_benchmark.modeling.backbone.resnet import StageSpec [as 別名]
def __init__(self, config):
        super(ResNet50Conv5ROIFeatureExtractor, self).__init__()

        resolution = config.MODEL.ROI_BOX_HEAD.POOLER_RESOLUTION
        scales = config.MODEL.ROI_BOX_HEAD.POOLER_SCALES
        sampling_ratio = config.MODEL.ROI_BOX_HEAD.POOLER_SAMPLING_RATIO
        pooler = Pooler(
            output_size=(resolution, resolution),
            scales=scales,
            sampling_ratio=sampling_ratio,
        )

        stage = resnet.StageSpec(index=4, block_count=3, return_features=False)
        head = resnet.ResNetHead(
            block_module=config.MODEL.RESNETS.TRANS_FUNC,
            stages=(stage,),
            num_groups=config.MODEL.RESNETS.NUM_GROUPS,
            width_per_group=config.MODEL.RESNETS.WIDTH_PER_GROUP,
            stride_in_1x1=config.MODEL.RESNETS.STRIDE_IN_1X1,
            stride_init=None,
            res2_out_channels=config.MODEL.RESNETS.RES2_OUT_CHANNELS,
        )

        self.pooler = pooler
        self.head = head 
開發者ID:HRNet,項目名稱:HRNet-MaskRCNN-Benchmark,代碼行數:27,代碼來源:roi_box_feature_extractors.py

示例3: __init__

# 需要導入模塊: from maskrcnn_benchmark.modeling.backbone import resnet [as 別名]
# 或者: from maskrcnn_benchmark.modeling.backbone.resnet import StageSpec [as 別名]
def __init__(self, config, in_channels):
        super(ResNet50Conv5ROIFeatureExtractor, self).__init__()

        resolution = config.MODEL.ROI_BOX_HEAD.POOLER_RESOLUTION
        scales = config.MODEL.ROI_BOX_HEAD.POOLER_SCALES
        sampling_ratio = config.MODEL.ROI_BOX_HEAD.POOLER_SAMPLING_RATIO
        pooler = Pooler(
            output_size=(resolution, resolution),
            scales=scales,
            sampling_ratio=sampling_ratio,
        )

        stage = resnet.StageSpec(index=4, block_count=3, return_features=False)
        head = resnet.ResNetHead(
            block_module=config.MODEL.RESNETS.TRANS_FUNC,
            stages=(stage,),
            num_groups=config.MODEL.RESNETS.NUM_GROUPS,
            width_per_group=config.MODEL.RESNETS.WIDTH_PER_GROUP,
            stride_in_1x1=config.MODEL.RESNETS.STRIDE_IN_1X1,
            stride_init=None,
            res2_out_channels=config.MODEL.RESNETS.RES2_OUT_CHANNELS,
            dilation=config.MODEL.RESNETS.RES5_DILATION
        )

        self.pooler = pooler
        self.head = head
        self.out_channels = head.out_channels 
開發者ID:Res2Net,項目名稱:Res2Net-maskrcnn,代碼行數:29,代碼來源:roi_box_feature_extractors.py

示例4: __init__

# 需要導入模塊: from maskrcnn_benchmark.modeling.backbone import resnet [as 別名]
# 或者: from maskrcnn_benchmark.modeling.backbone.resnet import StageSpec [as 別名]
def __init__(self, config):
        super(ResNet50Conv5ROIFeatureExtractor, self).__init__()

        resolution = config.MODEL.ROI_BOX_HEAD.POOLER_RESOLUTION
        scales = config.MODEL.ROI_BOX_HEAD.POOLER_SCALES
        sampling_ratio = config.MODEL.ROI_BOX_HEAD.POOLER_SAMPLING_RATIO
        pooler = Pooler(
            output_size=(resolution, resolution),
            scales=scales,
            sampling_ratio=sampling_ratio,
        )

        stage = resnet.StageSpec(index=4, block_count=3, return_features=False)
        head = resnet.ResNetHead(
            block_module=config.MODEL.RESNETS.TRANS_FUNC,
            stages=(stage,),
            num_groups=config.MODEL.RESNETS.NUM_GROUPS,
            width_per_group=config.MODEL.RESNETS.WIDTH_PER_GROUP,
            stride_in_1x1=config.MODEL.RESNETS.STRIDE_IN_1X1,
            stride_init=None,
            res2_out_channels=config.MODEL.RESNETS.RES2_OUT_CHANNELS,
            dilation=config.MODEL.RESNETS.RES5_DILATION
        )

        self.pooler = pooler
        self.head = head 
開發者ID:clw5180,項目名稱:remote_sensing_object_detection_2019,代碼行數:28,代碼來源:roi_box_feature_extractors.py

示例5: __init__

# 需要導入模塊: from maskrcnn_benchmark.modeling.backbone import resnet [as 別名]
# 或者: from maskrcnn_benchmark.modeling.backbone.resnet import StageSpec [as 別名]
def __init__(self, config):
        super(ResNet50Conv5RecFeatureExtractor, self).__init__()
        # reso: [H, W]
        resolution = config.MODEL.ROI_REC_HEAD.POOLER_RESOLUTION
        scales = config.MODEL.ROI_REC_HEAD.POOLER_SCALES
        pooler = PyramidRROIAlign(
            output_size=resolution,
            scales=scales,
        )

        self.word_margin = config.MODEL.ROI_REC_HEAD.BOXES_MARGIN
        self.det_margin = config.MODEL.RRPN.GT_BOX_MARGIN

        self.rescale = self.word_margin / self.det_margin

        # stage = resnet.StageSpec(index=4, block_count=3, return_features=False)
        '''
        head = resnet.ResNetHead(
            block_module=config.MODEL.RESNETS.TRANS_FUNC,
            stages=(stage,),
            num_groups=config.MODEL.RESNETS.NUM_GROUPS,
            width_per_group=config.MODEL.RESNETS.WIDTH_PER_GROUP,
            stride_in_1x1=config.MODEL.RESNETS.STRIDE_IN_1X1,
            stride_init=None,
            res2_out_channels=config.MODEL.RESNETS.RES2_OUT_CHANNELS,
            dilation=config.MODEL.RESNETS.RES5_DILATION
        )
        '''
        self.pooler = pooler
        # self.head = head 
開發者ID:clw5180,項目名稱:remote_sensing_object_detection_2019,代碼行數:32,代碼來源:roi_rec_feature_extractors.py

示例6: __init__

# 需要導入模塊: from maskrcnn_benchmark.modeling.backbone import resnet [as 別名]
# 或者: from maskrcnn_benchmark.modeling.backbone.resnet import StageSpec [as 別名]
def __init__(self, config, in_channels):
        super(ResNet50Conv5ROIFeatureExtractor, self).__init__()

        resolution = config.MODEL.ROI_BOX_HEAD.POOLER_RESOLUTION
        scales = config.MODEL.ROI_BOX_HEAD.POOLER_SCALES
        sampling_ratio = config.MODEL.ROI_BOX_HEAD.POOLER_SAMPLING_RATIO
        pooler = Pooler(
            output_size=(resolution, resolution),
            scales=scales,
            sampling_ratio=sampling_ratio,
        )

        index = int(config.MODEL.BACKBONE.CONV_BODY.split('R-50-C')[1])                   # add by hui
        stage = resnet.StageSpec(index=index, block_count=3, return_features=False)
        head = resnet.ResNetHead(
            block_module=config.MODEL.RESNETS.TRANS_FUNC,
            stages=(stage,),
            num_groups=config.MODEL.RESNETS.NUM_GROUPS,
            width_per_group=config.MODEL.RESNETS.WIDTH_PER_GROUP,
            stride_in_1x1=config.MODEL.RESNETS.STRIDE_IN_1X1,
            stride_init=None,
            res2_out_channels=config.MODEL.RESNETS.RES2_OUT_CHANNELS,
            dilation=config.MODEL.RESNETS.RES5_DILATION
        )

        self.pooler = pooler
        self.head = head
        self.out_channels = head.out_channels 
開發者ID:ucas-vg,項目名稱:TinyBenchmark,代碼行數:30,代碼來源:roi_box_feature_extractors.py


注:本文中的maskrcnn_benchmark.modeling.backbone.resnet.StageSpec方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。