当前位置: 首页>>代码示例>>Python>>正文


Python proposal_target_layer_cascade._ProposalTargetLayer方法代码示例

本文整理汇总了Python中model.rpn.proposal_target_layer_cascade._ProposalTargetLayer方法的典型用法代码示例。如果您正苦于以下问题:Python proposal_target_layer_cascade._ProposalTargetLayer方法的具体用法?Python proposal_target_layer_cascade._ProposalTargetLayer怎么用?Python proposal_target_layer_cascade._ProposalTargetLayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在model.rpn.proposal_target_layer_cascade的用法示例。


在下文中一共展示了proposal_target_layer_cascade._ProposalTargetLayer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, classes, class_agnostic):
        super(_fasterRCNN, self).__init__()
        self.classes = classes
        self.n_classes = len(classes)
        self.class_agnostic = class_agnostic
        # loss
        self.RCNN_loss_cls = 0
        self.RCNN_loss_bbox = 0

        # define rpn
        self.RCNN_rpn = _RPN(self.dout_base_model)
        self.RCNN_proposal_target = _ProposalTargetLayer(self.n_classes)
        self.RCNN_roi_pool = _RoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)
        self.RCNN_roi_align = RoIAlignAvg(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)

        self.grid_size = cfg.POOLING_SIZE * 2 if cfg.CROP_RESIZE_WITH_MAX_POOL else cfg.POOLING_SIZE
        self.RCNN_roi_crop = _RoICrop() 
开发者ID:Feynman27,项目名称:pytorch-detect-to-track,代码行数:19,代码来源:faster_rcnn.py

示例2: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, classes, class_agnostic):
        super(_fasterRCNN, self).__init__()
        self.classes = classes
        self.n_classes = len(classes)
        self.class_agnostic = class_agnostic
        # loss
        self.RCNN_loss_cls = 0
        self.RCNN_loss_bbox = 0

        # define rpn
        self.RCNN_rpn = _RPN(self.dout_base_model)
        self.RCNN_proposal_target = _ProposalTargetLayer(self.n_classes)
        self.RCNN_roi_pool = _RoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE,
                                         1.0 / 16.0)
        self.RCNN_roi_align = RoIAlignAvg(cfg.POOLING_SIZE, cfg.POOLING_SIZE,
                                          1.0 / 16.0)

        self.grid_size = cfg.POOLING_SIZE * 2 if \
            cfg.CROP_RESIZE_WITH_MAX_POOL else cfg.POOLING_SIZE
        self.RCNN_roi_crop = _RoICrop() 
开发者ID:ucbdrive,项目名称:3d-vehicle-tracking,代码行数:22,代码来源:faster_rcnn.py

示例3: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, classes, class_agnostic, sup=False):
        super(_fasterRCNN, self).__init__()
        self.classes = classes
        self.n_classes = len(classes)
        self.class_agnostic = class_agnostic
        # loss
        self.RCNN_loss_cls = 0
        self.RCNN_loss_bbox = 0

        # define rpn
        self.RCNN_rpn = _RPN(self.dout_base_model)
        self.RCNN_proposal_target = _ProposalTargetLayer(self.n_classes)
        self.RCNN_roi_pool = _RoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)
        self.RCNN_roi_align = RoIAlignAvg(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)

        self.grid_size = cfg.POOLING_SIZE * 2 if cfg.CROP_RESIZE_WITH_MAX_POOL else cfg.POOLING_SIZE
        self.RCNN_roi_crop = _RoICrop()
        self.sup = sup 
开发者ID:twangnh,项目名称:Distilling-Object-Detectors,代码行数:20,代码来源:faster_rcnn.py

示例4: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, classes, class_agnostic):
        super(_RFCN, self).__init__()
        self.classes = classes
        self.n_classes = len(classes)
        self.class_agnostic = class_agnostic
        # loss
        self.RCNN_loss_cls = 0
        self.RCNN_loss_bbox = 0

        self.box_num_classes = 1 if class_agnostic else self.n_classes

        # define rpn
        self.RCNN_rpn = _RPN(self.dout_base_model)
        self.RCNN_proposal_target = _ProposalTargetLayer(self.n_classes)
        self.RCNN_psroi_pool_cls = PSRoIPool(cfg.POOLING_SIZE, cfg.POOLING_SIZE,
                                          spatial_scale=1/16.0, group_size=cfg.POOLING_SIZE,
                                          output_dim=self.n_classes)
        self.RCNN_psroi_pool_loc = PSRoIPool(cfg.POOLING_SIZE, cfg.POOLING_SIZE,
                                          spatial_scale=1/16.0, group_size=cfg.POOLING_SIZE,
                                          output_dim=self.box_num_classes * 4)
        self.pooling = nn.AvgPool2d(kernel_size=cfg.POOLING_SIZE, stride=cfg.POOLING_SIZE)
        self.grid_size = cfg.POOLING_SIZE * 2 if cfg.CROP_RESIZE_WITH_MAX_POOL else cfg.POOLING_SIZE 
开发者ID:princewang1994,项目名称:RFCN_CoupleNet.pytorch,代码行数:24,代码来源:rfcn.py

示例5: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, classes, class_agnostic):
        super(_fasterRCNN, self).__init__()
        self.classes = classes
        self.n_classes = len(classes)
        self.class_agnostic = class_agnostic

        
        self.match_net = match_block(self.dout_base_model)


        # loss
        self.RCNN_loss_cls = 0
        self.RCNN_loss_bbox = 0

        # define rpn
        self.RCNN_rpn = _RPN(self.dout_base_model)
        self.RCNN_proposal_target = _ProposalTargetLayer(self.n_classes)

        # self.RCNN_roi_pool = _RoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)
        # self.RCNN_roi_align = RoIAlignAvg(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)

        self.RCNN_roi_pool = ROIPool((cfg.POOLING_SIZE, cfg.POOLING_SIZE), 1.0/16.0)
        self.RCNN_roi_align = ROIAlign((cfg.POOLING_SIZE, cfg.POOLING_SIZE), 1.0/16.0, 0)
        self.triplet_loss = torch.nn.MarginRankingLoss(margin = cfg.TRAIN.MARGIN) 
开发者ID:timy90022,项目名称:One-Shot-Object-Detection,代码行数:26,代码来源:faster_rcnn.py

示例6: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, classes, class_agnostic):
        super(_fasterRCNN, self).__init__()
        self.classes = classes
        self.n_classes = len(self.classes)
        self.class_agnostic = class_agnostic
        # loss
        self.RCNN_loss_cls = 0
        self.RCNN_loss_bbox = 0

        # define rpn
        self.RCNN_rpn = _RPN(self.dout_base_model)
        self.RCNN_proposal_target = _ProposalTargetLayer(self.n_classes)
        self.RCNN_roi_pool = _RoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0 / 16.0)
        self.RCNN_roi_align = RoIAlignAvg(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0 / 16.0)

        self.grid_size = cfg.POOLING_SIZE * 2 if cfg.CROP_RESIZE_WITH_MAX_POOL else cfg.POOLING_SIZE
        self.RCNN_roi_crop = _RoICrop() 
开发者ID:jinyu121,项目名称:CIOD,代码行数:19,代码来源:faster_rcnn.py

示例7: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, n_classes, class_agnostic):
        super(_fasterRCNN, self).__init__()
        self.n_classes = n_classes
        self.class_agnostic = class_agnostic
        # loss
        self.RCNN_loss_cls = 0
        self.RCNN_loss_bbox = 0

        # define rpn
        self.RCNN_rpn = _RPN(self.dout_base_model)
        self.RCNN_proposal_target = _ProposalTargetLayer(self.n_classes)
        self.RCNN_roi_pool = _RoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)
        self.RCNN_roi_align = RoIAlignAvg(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)

        self.grid_size = cfg.POOLING_SIZE * 2 if cfg.CROP_RESIZE_WITH_MAX_POOL else cfg.POOLING_SIZE
        self.RCNN_roi_crop = _RoICrop() 
开发者ID:violetteshev,项目名称:bottom-up-features,代码行数:18,代码来源:faster_rcnn.py

示例8: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, classes, class_agnostic):
        super(_fasterRCNN, self).__init__()
        self.classes = classes
        self.n_classes = len(classes)
        self.class_agnostic = class_agnostic
               # loss
        self.RCNN_loss_cls = 0
        self.RCNN_loss_bbox = 0

        # define rpn
        self.RCNN_rpn = _RPN(self.dout_base_model)
        self.RCNN_proposal_target = _ProposalTargetLayer(self.n_classes)
        self.RCNN_roi_pool = _RoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)
        self.RCNN_roi_align = RoIAlignAvg(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)

        self.grid_size = cfg.POOLING_SIZE * 2 if cfg.CROP_RESIZE_WITH_MAX_POOL else cfg.POOLING_SIZE
        self.RCNN_roi_crop = _RoICrop()

        self.Dis = Discriminator() 
开发者ID:TKKim93,项目名称:DivMatch,代码行数:21,代码来源:Divmatch_faster_rcnn_resnet.py

示例9: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, classes, class_agnostic):
        super(_da_fasterRCNN, self).__init__()
        self.classes = classes
        self.n_classes = len(classes)
        self.class_agnostic = class_agnostic
        # loss
        self.RCNN_loss_cls = 0
        self.RCNN_loss_bbox = 0

        # define rpn
        self.RCNN_rpn = _RPN(self.dout_base_model)
        self.RCNN_proposal_target = _ProposalTargetLayer(self.n_classes)
        self.RCNN_roi_pool = _RoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)
        self.RCNN_roi_align = RoIAlignAvg(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)

        self.grid_size = cfg.POOLING_SIZE * 2 if cfg.CROP_RESIZE_WITH_MAX_POOL else cfg.POOLING_SIZE
        self.RCNN_roi_crop = _RoICrop()

        self.Dis = Discriminator() 
开发者ID:TKKim93,项目名称:DivMatch,代码行数:21,代码来源:DivMatch_faster_rcnn_vgg16.py

示例10: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, classes, class_agnostic,context):
        super(_fasterRCNN, self).__init__()
        self.classes = classes
        self.n_classes = len(classes)
        self.class_agnostic = class_agnostic
        # loss
        self.RCNN_loss_cls = 0
        self.RCNN_loss_bbox = 0
        self.context = context
        # define rpn
        self.RCNN_rpn = _RPN(self.dout_base_model)
        self.RCNN_proposal_target = _ProposalTargetLayer(self.n_classes)
        self.RCNN_roi_pool = _RoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)
        self.RCNN_roi_align = RoIAlignAvg(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)

        self.grid_size = cfg.POOLING_SIZE * 2 if cfg.CROP_RESIZE_WITH_MAX_POOL else cfg.POOLING_SIZE
        self.RCNN_roi_crop = _RoICrop() 
开发者ID:VisionLearningGroup,项目名称:DA_Detection,代码行数:19,代码来源:faster_rcnn_global.py

示例11: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, classes, class_agnostic,lc):
        super(_fasterRCNN, self).__init__()
        self.classes = classes
        self.n_classes = len(classes)
        self.class_agnostic = class_agnostic
        # loss
        self.RCNN_loss_cls = 0
        self.RCNN_loss_bbox = 0
        self.lc = lc
        # define rpn
        self.RCNN_rpn = _RPN(self.dout_base_model)
        self.RCNN_proposal_target = _ProposalTargetLayer(self.n_classes)
        self.RCNN_roi_pool = _RoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)
        self.RCNN_roi_align = RoIAlignAvg(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)

        self.grid_size = cfg.POOLING_SIZE * 2 if cfg.CROP_RESIZE_WITH_MAX_POOL else cfg.POOLING_SIZE
        self.RCNN_roi_crop = _RoICrop() 
开发者ID:VisionLearningGroup,项目名称:DA_Detection,代码行数:19,代码来源:faster_rcnn_local.py

示例12: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, classes, class_agnostic,lc,gc):
        super(_fasterRCNN, self).__init__()
        self.classes = classes
        self.n_classes = len(classes)
        self.class_agnostic = class_agnostic
        # loss
        self.RCNN_loss_cls = 0
        self.RCNN_loss_bbox = 0
        self.lc = lc
        self.gc = gc
        # define rpn
        self.RCNN_rpn = _RPN(self.dout_base_model)
        self.RCNN_proposal_target = _ProposalTargetLayer(self.n_classes)
        self.RCNN_roi_pool = _RoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)
        self.RCNN_roi_align = RoIAlignAvg(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)

        self.grid_size = cfg.POOLING_SIZE * 2 if cfg.CROP_RESIZE_WITH_MAX_POOL else cfg.POOLING_SIZE
        self.RCNN_roi_crop = _RoICrop() 
开发者ID:VisionLearningGroup,项目名称:DA_Detection,代码行数:20,代码来源:faster_rcnn_global_local.py

示例13: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, classes, class_agnostic):
        super(_RFCN, self).__init__()
        self.classes = classes
        self.n_classes = len(classes)
        self.n_reg_classes = (1 if class_agnostic else len(classes))
        self.class_agnostic = class_agnostic
        self.n_bbox_reg = (4 if class_agnostic else len(classes))
        # loss
        self.RFCN_loss_cls = 0
        self.RFCN_loss_bbox = 0

        # define rpn
        self.RFCN_rpn = _RPN(self.dout_base_model)
        self.RFCN_proposal_target = _ProposalTargetLayer(self.n_classes)
        self.RFCN_tracking_proposal_target = _TrackingProposalTargetLayer(self.n_classes)
        #self.RFCN_roi_pool = _RoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)
        self.RFCN_psroi_cls_pool = _PSRoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 
                                spatial_scale=1.0/16.0, group_size=7, output_dim=self.n_classes)
        self.RFCN_psroi_loc_pool = _PSRoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 
                                spatial_scale=1.0/16.0, group_size=7, output_dim=4*self.n_reg_classes)
        #self.RFCN_roi_align = RoIAlignAvg(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)

        self.grid_size = cfg.POOLING_SIZE * 2 if cfg.CROP_RESIZE_WITH_MAX_POOL else cfg.POOLING_SIZE
        #self.RFCN_roi_crop = _RoICrop()

	self.RFCN_cls_net = nn.Conv2d(512,self.n_classes*7*7, [1,1], padding=0, stride=1)
        nn.init.normal(self.RFCN_cls_net.weight.data, 0.0, 0.01)
        
	self.RFCN_bbox_net = nn.Conv2d(512, 4*self.n_reg_classes*7*7, [1,1], padding=0, stride=1)
	nn.init.normal(self.RFCN_bbox_net.weight.data, 0.0, 0.01)

	#self.corr_bbox_net = nn.Conv2d(1051, 4*self.n_reg_classes*7*7, [1,1], padding=0, stride=1)
	#nn.init.normal(self.corr_bbox_net.weight.data, 0.0, 0.01)

	self.conv3_corr_layer = Correlation(pad_size=8, kernel_size=1, max_displacement=8, stride1=2, stride2=2)
	self.conv4_corr_layer = Correlation(pad_size=8, kernel_size=1, max_displacement=8, stride1=1, stride2=1)
	self.conv5_corr_layer = Correlation(pad_size=8, kernel_size=1, max_displacement=8, stride1=1, stride2=1) 

        self.RFCN_cls_score = nn.AvgPool2d((7,7), stride=(7,7))
        self.RFCN_bbox_pred = nn.AvgPool2d((7,7), stride=(7,7))
        self.RFCN_tracking_pred = nn.AvgPool2d((7,7), stride=(7,7)) 
开发者ID:Feynman27,项目名称:pytorch-detect-to-track,代码行数:43,代码来源:rfcn.py

示例14: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, classes, class_agnostic):
        super(CoupleNet, self).__init__()
        self.classes = classes
        self.n_classes = len(classes)
        self.class_agnostic = class_agnostic
        # loss
        self.RCNN_loss_cls = 0
        self.RCNN_loss_bbox = 0

        self.box_num_classes = 1 if class_agnostic else self.n_classes

        # define rpn
        self.RCNN_rpn = _RPN(self.dout_base_model)
        self.RCNN_proposal_target = _ProposalTargetLayer(self.n_classes)

        self.RCNN_roi_pool = _RoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0 / 16.0)
        self.RCNN_roi_align = RoIAlignAvg(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0 / 16.0)
        self.RCNN_roi_crop = _RoICrop()

        self.RCNN_psroi_pool_cls = PSRoIPool(cfg.POOLING_SIZE, cfg.POOLING_SIZE,
                                          spatial_scale=1/16.0, group_size=cfg.POOLING_SIZE,
                                          output_dim=self.n_classes)
        self.RCNN_psroi_pool_loc = PSRoIPool(cfg.POOLING_SIZE, cfg.POOLING_SIZE,
                                          spatial_scale=1/16.0, group_size=cfg.POOLING_SIZE,
                                          output_dim=self.box_num_classes * 4)
        self.avg_pooling = nn.AvgPool2d(kernel_size=cfg.POOLING_SIZE, stride=cfg.POOLING_SIZE)
        self.grid_size = cfg.POOLING_SIZE * 2 if cfg.CROP_RESIZE_WITH_MAX_POOL else cfg.POOLING_SIZE 
开发者ID:princewang1994,项目名称:RFCN_CoupleNet.pytorch,代码行数:29,代码来源:couplenet.py

示例15: __init__

# 需要导入模块: from model.rpn import proposal_target_layer_cascade [as 别名]
# 或者: from model.rpn.proposal_target_layer_cascade import _ProposalTargetLayer [as 别名]
def __init__(self, classes, class_agnostic, lighthead=False, compact_mode=False):
        super(_fasterRCNN, self).__init__()
        self.classes = classes
        self.n_classes = len(classes)
        self.class_agnostic = class_agnostic
        self.lighthead = lighthead

        # loss
        self.RCNN_loss_cls = 0
        self.RCNN_loss_bbox = 0

        # define Large Separable Convolution Layer
        if self.lighthead:
            self.lh_mode = 'S' if compact_mode else 'L'
            self.lsconv = LargeSeparableConv2d(
                self.dout_lh_base_model, bias=False, bn=False, setting=self.lh_mode)
            self.lh_relu = nn.ReLU(inplace=True)

        # define rpn
        self.RCNN_rpn = _RPN(self.dout_base_model)
        self.RCNN_proposal_target = _ProposalTargetLayer(self.n_classes)
        self.RCNN_roi_pool = _RoIPooling(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)
        self.RCNN_roi_align = RoIAlignAvg(cfg.POOLING_SIZE, cfg.POOLING_SIZE, 1.0/16.0)

        self.grid_size = cfg.POOLING_SIZE * 2 if cfg.CROP_RESIZE_WITH_MAX_POOL else cfg.POOLING_SIZE
        self.RCNN_roi_crop = _RoICrop()
        self.rpn_time = None
        self.pre_roi_time = None
        self.roi_pooling_time = None
        self.subnet_time = None 
开发者ID:chengsq,项目名称:pytorch-lighthead,代码行数:32,代码来源:faster_rcnn.py


注:本文中的model.rpn.proposal_target_layer_cascade._ProposalTargetLayer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。