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


Python imdb.__init__方法代碼示例

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


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

示例1: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [as 別名]
def __init__(self, image_set, year, dist_path=None):
    imdb.__init__(self, image_set)
    self._year = year
    self._image_set = image_set.split('dist_')[1]
    self._dist_path = self._get_default_path() if dist_path is None \
                            else dist_path
    self._data_path=self._dist_path
    self._classes = ('__background__',  # always index 0
                     'tamper','authentic')
    self._classes = ('authentic',  # always index 0
                    'tamper')
    #self.classes =('authentic',  # always index 0
                    #'splicing','removal')
    self._class_to_ind = dict(list(zip(self.classes, list(range(self.num_classes)))))
    self._image_ext = {'.png','.jpg','.tif','.bmp','.JPG'}
    self._image_index = self._load_image_set_index()
    # Default to roidb handler
    self._roidb_handler = self.gt_roidb

    assert os.path.exists(self._data_path), \
      'Path does not exist: {}'.format(self._data_path) 
開發者ID:pengzhou1108,項目名稱:RGB-N,代碼行數:23,代碼來源:dvmm.py

示例2: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [as 別名]
def __init__(self, image_set, year, dist_path=None):
    imdb.__init__(self, image_set)
    self._year = year
    self._image_set = image_set.split('dist_')[1]
    self._dist_path = self._get_default_path() if dist_path is None \
                            else dist_path
    self._data_path=self._dist_path
    self._classes = ('__background__',  # always index 0
                     'tamper','authentic')
    self._classes = ('__background__',  # always index 0
                     'splicing','removal','manipulation')
    self._classes = ('authentic',  # always index 0
                    'tamper')
    self._class_to_ind = dict(list(zip(self.classes, list(range(self.num_classes)))))
    self._image_ext = {'.png','.jpg','.tif','.bmp','.JPG'}
    self._image_index = self._load_image_set_index()
    # Default to roidb handler
    self._roidb_handler = self.gt_roidb

    assert os.path.exists(self._data_path), \
      'Path does not exist: {}'.format(self._data_path) 
開發者ID:pengzhou1108,項目名稱:RGB-N,代碼行數:23,代碼來源:nist.py

示例3: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [as 別名]
def __init__(self, image_set, year, dist_path=None):
    imdb.__init__(self, image_set)
    self._year = year
    self._image_set = image_set.split('face_')[1]
    self._dist_path = self._get_default_path() if dist_path is None \
                            else dist_path
    self._data_path=self._dist_path
    self._classes = ('__background__',  # always index 0
                     'tamper','authentic')
    #self._classes = ('authentic',  # always index 0
                     #'tamper')
    self._class_to_ind = dict(list(zip(self.classes, list(range(self.num_classes)))))
    self._image_ext = {'.png','.jpg','.tif','.bmp','.JPG'}
    self._image_index = self._load_image_set_index()
    # Default to roidb handler
    self._roidb_handler = self.gt_roidb

    assert os.path.exists(self._data_path), \
      'Path does not exist: {}'.format(self._data_path) 
開發者ID:pengzhou1108,項目名稱:RGB-N,代碼行數:21,代碼來源:swapme.py

示例4: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [as 別名]
def __init__(self, image_set, year, dist_path=None):
    imdb.__init__(self, image_set)
    self._year = year
    self._image_set = image_set.split('coco_')[1]
    self._dist_path = self._get_default_path() if dist_path is None \
                            else dist_path
    self._data_path=self._dist_path
    #self._data_path = os.path.join(self._dist_path, image_set)
    self._classes = ('__background__',  # always index 0
                     'tamper','authentic')
    self._classes = ('authentic',  # always index 0
                     'tamper')
    self._class_to_ind = dict(list(zip(self.classes, list(range(self.num_classes)))))
    #self._image_ext = {'.jpg','.tif'}
    self._image_ext = {'.png','.jpg','.tif','.bmp','.JPG'}
    self._image_index = self._load_image_set_index()
    # Default to roidb handler
    self._roidb_handler = self.gt_roidb

    assert os.path.exists(self._data_path), \
      'Path does not exist: {}'.format(self._data_path) 
開發者ID:pengzhou1108,項目名稱:RGB-N,代碼行數:23,代碼來源:coco.py

示例5: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [as 別名]
def __init__(self, image_set, split, devkit_path):
        imdb.__init__(self, 'wider')
        self._image_set = image_set         # {'train', 'test'}
        self._split = split                 # {1, 2, ..., 10}
        self._devkit_path = devkit_path     # /data2/hzjiang/Data/CS2
        # self._data_path = os.path.join(self._devkit_path, 'data')
        self._data_path = self._devkit_path;
        self._classes = ('__background__', # always index 0
                         'face')
        self._class_to_ind = dict(zip(self.classes, xrange(self.num_classes)))
        self._image_ext = ['.png']
        self._image_index, self._gt_roidb = self._load_image_set_index()
        # Default to roidb handler
        self._roidb_handler = self.selective_search_roidb

        # Specific config options
        self.config = {'cleanup'  : True,
                       'use_salt' : True,
                       'top_k'    : 2000}

        assert os.path.exists(self._devkit_path), \
                'Devkit path does not exist: {}'.format(self._devkit_path)
        assert os.path.exists(self._data_path), \
                'Path does not exist: {}'.format(self._data_path) 
開發者ID:playerkk,項目名稱:face-py-faster-rcnn,代碼行數:26,代碼來源:face.py

示例6: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [as 別名]
def __init__(self, image_set, modality, data_filter, imp_type, devkit_path=None):
    imdb.__init__(self, 'kaist_' + image_set + '_' + modality + '_' + data_filter + imp_type)
    self._image_set = image_set
    self._modality = modality
    if modality == 'multi':
      print('set cfg.MULTI_INPUT -> True')
      cfg.MULTI_INPUT = True
    self._data_filter = data_filter
    self._imp_type = imp_type
    self._data_path = self._get_default_path()
    self._classes = ('__background__',  # always index 0
                     'person')
    self._class_to_ind = dict(list(zip(self.classes, list(range(self.num_classes)))))
    self._image_ext = '.png'
    self._image_index = self._load_image_set_index()
    # Default to roidb handler
    self._roidb_handler = self.gt_roidb

    assert os.path.exists(self._data_path), \
      'Kaist path does not exist: {}'.format(self._data_path) 
開發者ID:Li-Chengyang,項目名稱:MSDS-RCNN,代碼行數:22,代碼來源:kaist.py

示例7: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [as 別名]
def __init__(self, image_set, year, use_diff=False):
    name = 'voc_' + year + '_' + image_set
    if use_diff:
      name += '_diff'
    imdb.__init__(self, name)
    self._year = year
    self._image_set = image_set
    self._devkit_path = self._get_default_path()
    self._data_path = os.path.join(self._devkit_path, 'VOC' + self._year)
    self._classes = (  # always index 0
                     'aeroplane', 'bicycle', 'bird', 'boat',
                     'bottle', 'bus', 'car', 'cat', 'chair',
                     'cow', 'diningtable', 'dog', 'horse',
                     'motorbike', 'person', 'pottedplant',
                     'sheep', 'sofa', 'train', 'tvmonitor')
    self._class_to_ind = dict(list(zip(self.classes, list(range(self.num_classes)))))
    self._image_ext = '.jpg'
    self._image_index = self._load_image_set_index()
    # Default to roidb handler
    self._roidb_handler = self.selective_search_roidb
    self._salt = str(uuid.uuid4())
    self._comp_id = 'comp4'

    # PASCAL specific config options
    self.config = {'cleanup': True,
                   'use_salt': True,
                   'use_diff': use_diff,
                   'matlab_eval': False,
                   'rpn_file': None}

    assert os.path.exists(self._devkit_path), \
      'VOCdevkit path does not exist: {}'.format(self._devkit_path)
    assert os.path.exists(self._data_path), \
      'Path does not exist: {}'.format(self._data_path) 
開發者ID:Sunarker,項目名稱:Collaborative-Learning-for-Weakly-Supervised-Object-Detection,代碼行數:36,代碼來源:pascal_voc.py

示例8: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [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',
    }
    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:Sunarker,項目名稱:Collaborative-Learning-for-Weakly-Supervised-Object-Detection,代碼行數:38,代碼來源:coco.py

示例9: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [as 別名]
def __init__(self, image_set, year, devkit_path=None):
    imdb.__init__(self, 'voc_' + year + '_' + image_set)
    self._year = year
    self._image_set = image_set
    self._devkit_path = self._get_default_path() if devkit_path is None \
      else devkit_path

    
    self._data_path = os.path.join(self._devkit_path, 'VOC' + self._year)
    self._classes = ('__background__',  # always index 0
                     'aeroplane', 'bicycle', 'bird', 'boat',
                     'bottle', 'bus', 'car', 'cat', 'chair',
                     'cow', 'diningtable', 'dog', 'horse',
                     'motorbike', 'person', 'pottedplant',
                     'sheep', 'sofa', 'train', 'tvmonitor')
    self._class_to_ind = dict(list(zip(self.classes, list(range(self.num_classes)))))
    self._image_ext = '.jpg'
    self._image_index = self._load_image_set_index()
    # Default to roidb handler
    self._roidb_handler = self.gt_roidb
    self._salt = str(uuid.uuid4())
    self._comp_id = 'comp4'

    # PASCAL specific config options
    self.config = {'cleanup': True,
                   'use_salt': True,
                   'use_diff': False,
                   'matlab_eval': False,
                   'rpn_file': None}

    assert os.path.exists(self._devkit_path), \
      'VOCdevkit path does not exist: {}'.format(self._devkit_path)
    assert os.path.exists(self._data_path), \
      'Path does not exist: {}'.format(self._data_path) 
開發者ID:guoruoqian,項目名稱:cascade-rcnn_Pytorch,代碼行數:36,代碼來源:pascal_voc_rbg.py

示例10: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [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

示例11: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [as 別名]
def __init__(self, image_set, year, use_diff=False):
    name = 'voc_' + year + '_' + image_set
    if use_diff:
      name += '_diff'
    imdb.__init__(self, name)
    self._year = year
    self._image_set = image_set
    self._devkit_path = self._get_default_path()
    self._data_path = os.path.join(self._devkit_path, 'VOC' + self._year)
    self._classes = ('__background__',  # always index 0
                     'aeroplane', 'bicycle', 'bird', 'boat',
                     'bottle', 'bus', 'car', 'cat', 'chair',
                     'cow', 'diningtable', 'dog', 'horse',
                     'motorbike', 'person', 'pottedplant',
                     'sheep', 'sofa', 'train', 'tvmonitor')
    self._class_to_ind = dict(list(zip(self.classes, list(range(self.num_classes)))))
    self._image_ext = '.jpg'
    self._image_index = self._load_image_set_index()
    # Default to roidb handler
    self._roidb_handler = self.gt_roidb
    self._salt = str(uuid.uuid4())
    self._comp_id = 'comp4'

    # PASCAL specific config options
    self.config = {'cleanup': True,
                   'use_salt': True,
                   'use_diff': use_diff,
                   'matlab_eval': False,
                   'rpn_file': None}

    assert os.path.exists(self._devkit_path), \
      'VOCdevkit path does not exist: {}'.format(self._devkit_path)
    assert os.path.exists(self._data_path), \
      'Path does not exist: {}'.format(self._data_path) 
開發者ID:yxgeee,項目名稱:pytorch-FPN,代碼行數:36,代碼來源:pascal_voc.py

示例12: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [as 別名]
def __init__(self, image_set, use_diff=False):
        name = 'wider_face' + '_' + image_set
        if use_diff:
            name += '_diff'
        imdb.__init__(self, name)
        self._image_set = image_set
        self._data_path = self._get_default_path()
        self._classes = ('__background__',  # always index 0
                         'face')
        self._class_to_ind = dict(list(zip(self.classes, list(range(self.num_classes)))))
        self._image_ext = '.jpg'
        self._image_index, self.bboxes = self._load_image_set_index_and_annotations()
        # Default to roidb handler
        self._roidb_handler = self.gt_roidb
        self._salt = str(uuid.uuid4())
        self._comp_id = 'comp4'

        # PASCAL specific config options
        self.config = {'cleanup': True,
                       'use_salt': True,
                       'use_diff': use_diff,
                       'matlab_eval': False,
                       'rpn_file': None}

        assert os.path.exists(self._data_path), \
            'Path does not exist: {}'.format(self._data_path) 
開發者ID:wanjinchang,項目名稱:SSH-TensorFlow,代碼行數:28,代碼來源:wider_face.py

示例13: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [as 別名]
def __init__(self, image_set, year, use_diff=False):
        name = 'voc_' + year + '_' + image_set
        if use_diff:
            name += '_diff'
        imdb.__init__(self, name)
        self._year = year
        self._image_set = image_set
        self._devkit_path = self._get_default_path()
        self._data_path = os.path.join(self._devkit_path, 'VOC' + self._year)
        self._classes = ('__background__',  # always index 0
                         'text')
        self._class_to_ind = dict(list(zip(self.classes, list(range(self.num_classes)))))
        self._image_ext = '.jpg'
        self._image_index = self._load_image_set_index()
        # Default to roidb handler
        self._roidb_handler = self.gt_roidb
        self._salt = str(uuid.uuid4())
        self._comp_id = 'comp4'

        # PASCAL specific config options
        self.config = {'cleanup': True,
                       'use_salt': True,
                       'use_diff': use_diff,
                       'matlab_eval': False,
                       'rpn_file': None}

        assert os.path.exists(self._devkit_path), \
            'VOCdevkit path does not exist: {}'.format(self._devkit_path)
        assert os.path.exists(self._data_path), \
            'Path does not exist: {}'.format(self._data_path) 
開發者ID:Sanster,項目名稱:tf_ctpn,代碼行數:32,代碼來源:pascal_voc.py

示例14: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [as 別名]
def __init__(self, image_set, year, devkit_path=None):
        imdb.__init__(self, 'voc_' + year + '_' + image_set)
        self._year = year
        self._image_set = image_set
        self._devkit_path = self._get_default_path() if devkit_path is None \
            else devkit_path

        self._data_path = os.path.join(self._devkit_path, 'VOC' + self._year)
        self._classes = ('__background__',  # always index 0
                         'aeroplane', 'bicycle', 'bird', 'boat',
                         'bottle', 'bus', 'car', 'cat', 'chair',
                         'cow', 'diningtable', 'dog', 'horse',
                         'motorbike', 'person', 'pottedplant',
                         'sheep', 'sofa', 'train', 'tvmonitor')
        self._class_to_ind = dict(
            list(zip(self.classes, list(range(self.num_classes)))))
        self._image_ext = '.jpg'
        self._image_index = self._load_image_set_index()
        # Default to roidb handler
        self._roidb_handler = self.gt_roidb
        self._salt = str(uuid.uuid4())
        self._comp_id = 'comp4'

        # PASCAL specific config options
        self.config = {'cleanup': True,
                       'use_salt': True,
                       'use_diff': False,
                       'matlab_eval': False,
                       'rpn_file': None}

        assert os.path.exists(self._devkit_path), \
            'VOCdevkit path does not exist: {}'.format(self._devkit_path)
        assert os.path.exists(self._data_path), \
            'Path does not exist: {}'.format(self._data_path) 
開發者ID:ucbdrive,項目名稱:3d-vehicle-tracking,代碼行數:36,代碼來源:pascal_voc_rbg.py

示例15: __init__

# 需要導入模塊: from datasets.imdb import imdb [as 別名]
# 或者: from datasets.imdb.imdb import __init__ [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:ucbdrive,項目名稱:3d-vehicle-tracking,代碼行數:42,代碼來源:coco.py


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