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


Python cfg.DATA_DIR屬性代碼示例

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


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

示例1: _load_selective_search_roidb

# 需要導入模塊: from model.utils.config import cfg [as 別名]
# 或者: from model.utils.config.cfg import DATA_DIR [as 別名]
def _load_selective_search_roidb(self, gt_roidb):
        filename = os.path.abspath(os.path.join(cfg.DATA_DIR,
                                                'selective_search_data',
                                                self.name + '.mat'))
        assert os.path.exists(filename), \
            'Selective search data not found at: {}'.format(filename)
        raw_data = sio.loadmat(filename)['boxes'].ravel()

        box_list = []
        for i in xrange(raw_data.shape[0]):
            boxes = raw_data[i][:, (1, 0, 3, 2)] - 1
            keep = ds_utils.unique_boxes(boxes)
            boxes = boxes[keep, :]
            keep = ds_utils.filter_small_boxes(boxes, self.config['min_size'])
            boxes = boxes[keep, :]
            box_list.append(boxes)

        return self.create_roidb_from_box_list(box_list, gt_roidb) 
開發者ID:guoruoqian,項目名稱:cascade-rcnn_Pytorch,代碼行數:20,代碼來源:pascal_voc.py

示例2: _get_default_path

# 需要導入模塊: from model.utils.config import cfg [as 別名]
# 或者: from model.utils.config.cfg import DATA_DIR [as 別名]
def _get_default_path(self):
    """
    Return the default path where PASCAL VOC is expected to be installed.
    """
    return os.path.join(cfg.DATA_DIR, 'VOCdevkit' + self._year) 
開發者ID:guoruoqian,項目名稱:cascade-rcnn_Pytorch,代碼行數:7,代碼來源:pascal_voc_rbg.py

示例3: _get_default_path

# 需要導入模塊: from model.utils.config import cfg [as 別名]
# 或者: from model.utils.config.cfg import DATA_DIR [as 別名]
def _get_default_path(self):
        """
        Return the default path where PASCAL VOC is expected to be installed.
        """
        return os.path.join(cfg.DATA_DIR, 'VOCdevkit' + self._year) 
開發者ID:guoruoqian,項目名稱:cascade-rcnn_Pytorch,代碼行數:7,代碼來源:pascal_voc.py

示例4: __init__

# 需要導入模塊: from model.utils.config import cfg [as 別名]
# 或者: from model.utils.config.cfg import DATA_DIR [as 別名]
def __init__(self, image_set, year):
    imdb.__init__(self, 'coco_' + year + '_' + image_set)
    # COCO specific config options
    self.config = {'use_salt': True,
                   'cleanup': True}
    # name, paths
    self._year = year
    self._image_set = image_set
    self._data_path = osp.join(cfg.DATA_DIR, 'coco')
    # load COCO API, classes, class <-> id mappings
    self._COCO = COCO(self._get_ann_file())
    cats = self._COCO.loadCats(self._COCO.getCatIds())
    self._classes = tuple(['__background__'] + [c['name'] for c in cats])
    self._class_to_ind = dict(list(zip(self.classes, list(range(self.num_classes)))))
    self._class_to_coco_cat_id = dict(list(zip([c['name'] for c in cats],
                                               self._COCO.getCatIds())))
    self._image_index = self._load_image_set_index()
    # Default to roidb handler
    self.set_proposal_method('gt')
    self.competition_mode(False)

    # Some image sets are "views" (i.e. subsets) into others.
    # For example, minival2014 is a random 5000 image subset of val2014.
    # This mapping tells us where the view's images and proposals come from.
    self._view_map = {
      'minival2014': 'val2014',  # 5k val2014 subset
      'valminusminival2014': 'val2014',  # val2014 \setminus minival2014
      'test-dev2015': 'test2015',
      'valminuscapval2014': 'val2014',
      'capval2014': 'val2014',
      'captest2014': 'val2014'
    }
    coco_name = image_set + year  # e.g., "val2014"
    self._data_name = (self._view_map[coco_name]
                       if coco_name in self._view_map
                       else coco_name)
    # Dataset splits that have ground-truth annotations (test splits
    # do not have gt annotations)
    self._gt_splits = ('train', 'val', 'minival') 
開發者ID:guoruoqian,項目名稱:cascade-rcnn_Pytorch,代碼行數:41,代碼來源:coco.py

示例5: cache_path

# 需要導入模塊: from model.utils.config import cfg [as 別名]
# 或者: from model.utils.config.cfg import DATA_DIR [as 別名]
def cache_path(self):
    cache_path = osp.abspath(osp.join(cfg.DATA_DIR, 'cache'))
    if not os.path.exists(cache_path):
      os.makedirs(cache_path)
    return cache_path 
開發者ID:guoruoqian,項目名稱:cascade-rcnn_Pytorch,代碼行數:7,代碼來源:imdb.py


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