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


Python minibatch.get_minibatch方法代码示例

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


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

示例1: _get_next_minibatch

# 需要导入模块: from roi_data_layer import minibatch [as 别名]
# 或者: from roi_data_layer.minibatch import get_minibatch [as 别名]
def _get_next_minibatch(self):
        """Return the blobs to be used for the next minibatch.

        If cfg.TRAIN.USE_PREFETCH is True, then blobs will be computed in a
        separate process and made available through self._blob_queue.
        """
        if cfg.TRAIN.USE_PREFETCH:
            return self._blob_queue.get()
        else:
            db_inds = self._get_next_minibatch_inds()
            minibatch_db = [self._roidb[i] for i in db_inds]
            if cfg.TRAIN.USE_OHEM:
                blobs = get_allrois_minibatch(minibatch_db, self._num_classes)
            else:
                blobs = get_minibatch(minibatch_db, self._num_classes)

            return blobs 
开发者ID:Eniac-Xie,项目名称:faster-rcnn-resnet,代码行数:19,代码来源:layer.py

示例2: __getitem__

# 需要导入模块: from roi_data_layer import minibatch [as 别名]
# 或者: from roi_data_layer.minibatch import get_minibatch [as 别名]
def __getitem__(self, index):
    # get the anchor index for current sample index
    # here we set the anchor index to the last one
    # sample in this group
        minibatch_db =  [self._roidb[index]] # [self._roidb[index_ratio]]
        blobs = get_minibatch(minibatch_db, self._num_classes)
        np.random.shuffle(blobs['rois'])
        rois = torch.from_numpy(blobs['rois'][:self.max_rois_size])
        data = torch.from_numpy(blobs['data'])
        labels = torch.from_numpy(blobs['labels'])
        data_height, data_width = data.size(1), data.size(2)
        
        data = data.permute(0, 3, 1, 2).contiguous().view(3, data_height, data_width)

        info = torch.Tensor([rois.size(0), data_height, data_width])
    
        return data, rois, labels, info 
开发者ID:jd730,项目名称:OICR-pytorch,代码行数:19,代码来源:roibatchLoader.py

示例3: _get_next_minibatch

# 需要导入模块: from roi_data_layer import minibatch [as 别名]
# 或者: from roi_data_layer.minibatch import get_minibatch [as 别名]
def _get_next_minibatch(self):
    """Return the blobs to be used for the next minibatch.

    If cfg.TRAIN.USE_PREFETCH is True, then blobs will be computed in a
    separate process and made available through self._blob_queue.
    """
    db_inds = self._get_next_minibatch_inds()
    minibatch_db = [self._roidb[i] for i in db_inds]
    return get_minibatch(minibatch_db, self._num_classes) 
开发者ID:Sunarker,项目名称:Collaborative-Learning-for-Weakly-Supervised-Object-Detection,代码行数:11,代码来源:layer.py

示例4: _get_next_minibatch

# 需要导入模块: from roi_data_layer import minibatch [as 别名]
# 或者: from roi_data_layer.minibatch import get_minibatch [as 别名]
def _get_next_minibatch(self):
        """Return the blobs to be used for the next minibatch.

        If cfg.TRAIN.USE_PREFETCH is True, then blobs will be computed in a
        separate process and made available through self._blob_queue.
        """
        db_inds = self._get_next_minibatch_inds()
        minibatch_db = [self._roidb[i] for i in db_inds]
        return get_minibatch(minibatch_db, self._num_classes) 
开发者ID:wanjinchang,项目名称:SSH-TensorFlow,代码行数:11,代码来源:layer.py

示例5: _get_next_minibatch

# 需要导入模块: from roi_data_layer import minibatch [as 别名]
# 或者: from roi_data_layer.minibatch import get_minibatch [as 别名]
def _get_next_minibatch(self):
        """Return the blobs to be used for the next minibatch.

        If cfg.TRAIN.USE_PREFETCH is True, then blobs will be computed in a
        separate process and made available through self._blob_queue.
        """
        if cfg.TRAIN.USE_PREFETCH:
            return self._blob_queue.get()
        else:
            db_inds = self._get_next_minibatch_inds()
            minibatch_db = [self._roidb[i] for i in db_inds]
            return get_minibatch(minibatch_db, self._num_classes) 
开发者ID:ppengtang,项目名称:dpl,代码行数:14,代码来源:layer.py

示例6: run

# 需要导入模块: from roi_data_layer import minibatch [as 别名]
# 或者: from roi_data_layer.minibatch import get_minibatch [as 别名]
def run(self):
        print 'BlobFetcher started'
        while True:
            db_inds = self._get_next_minibatch_inds()
            minibatch_db = [self._roidb[i] for i in db_inds]
            blobs = get_minibatch(minibatch_db, self._num_classes)
            self._queue.put(blobs) 
开发者ID:ppengtang,项目名称:dpl,代码行数:9,代码来源:layer.py

示例7: run

# 需要导入模块: from roi_data_layer import minibatch [as 别名]
# 或者: from roi_data_layer.minibatch import get_minibatch [as 别名]
def run(self):
        print 'BlobFetcher started'
        while True:
            db_inds = self._get_next_minibatch_inds()
            minibatch_db = [self._roidb[i] for i in db_inds]
            if cfg.TRAIN.USE_OHEM:
                blobs = get_allrois_minibatch(minibatch_db, self._num_classes)
            else:
                blobs = get_minibatch(minibatch_db, self._num_classes)
            self._queue.put(blobs) 
开发者ID:Eniac-Xie,项目名称:faster-rcnn-resnet,代码行数:12,代码来源:layer.py

示例8: _get_next_minibatch

# 需要导入模块: from roi_data_layer import minibatch [as 别名]
# 或者: from roi_data_layer.minibatch import get_minibatch [as 别名]
def _get_next_minibatch(self, db_inds):
        """Return the blobs to be used for the next minibatch.
        """
        minibatch_db = [self._roidb[i] for i in db_inds]
        if cfg.TRAIN.USE_RPN_DB:
            minibatch_db = self.imdb.add_rpn_rois(minibatch_db)
        prepare_roidb(minibatch_db)
        add_bbox_regression_targets(minibatch_db, self.bbox_means,
                                    self.bbox_stds)

        blobs = get_minibatch(minibatch_db, self._num_classes)
        if blobs is not None:
            blobs['db_inds'] = db_inds
        return blobs 
开发者ID:danfeiX,项目名称:scene-graph-TF-release,代码行数:16,代码来源:layer.py


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