当前位置: 首页>>代码示例>>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;未经允许,请勿转载。