コード例 #1
0
ファイル: factory.py プロジェクト: simblah/SGRN_torch
        __sets[name] = (lambda split=split, year=year: pascal_voc(
            split, year, use_diff=True))

# # Set up coco_2014_<split>
# for year in ['2014']:
#     for split in ['train', 'val', 'minival', 'valminusminival', 'trainval']:
#         name = 'coco_{}_{}'.format(year, split)
#         __sets[name] = (lambda split=split, year=year: coco(split, year))
#
# # Set up coco_2015_<split>
# for year in ['2015']:
#     for split in ['test', 'test-dev']:
#         name = 'coco_{}_{}'.format(year, split)
#         __sets[name] = (lambda split=split, year=year: coco(split, year))

for split in ['train', 'val', 'test']:
    name = 'visual_genome_{}'.format(split)
    __sets[name] = (lambda split=split: visual_genome(split, use_diff=True))


def get_imdb(name):
    """Get an imdb (image database) by name."""
    if name not in __sets:
        raise KeyError('Unknown dataset: {}'.format(name))
    return __sets[name]()


def list_imdbs():
    """List all registered imdbs."""
    return list(__sets.keys())
コード例 #2
0
ファイル: factory.py プロジェクト: vanthaiunghoa/densecap
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Factory method for easily getting imdbs by name."""

__sets = {}

from datasets.visual_genome import visual_genome
import numpy as np

# Set up visual_genome_<split> using rpn mode
for version in ['1.0', '1.2']:
    for split in ['train', 'val', 'test']:
        name = 'vg_{}_{}'.format(version, split)
        __sets[name] = (
            lambda split=split, version=version: visual_genome(split, version))


def get_imdb(name):
    """Get an imdb (image database) by name."""
    if not __sets.has_key(name):
        raise KeyError('Unknown dataset: {}'.format(name))
    return __sets[name]()


def list_imdbs():
    """List all registered imdbs."""
    return __sets.keys()
コード例 #3
0
ファイル: factory.py プロジェクト: linjieyangsc/densecap
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------

"""Factory method for easily getting imdbs by name."""

__sets = {}

from datasets.visual_genome import visual_genome
import numpy as np
 
# Set up visual_genome_<split> using rpn mode
for version in ['1.0','1.2']:
    for split in ['train', 'val', 'test']:
        name = 'vg_{}_{}'.format(version, split)
        __sets[name] = (lambda split=split, version=version: visual_genome(split,version))

def get_imdb(name):
    """Get an imdb (image database) by name."""
    if not __sets.has_key(name):
        raise KeyError('Unknown dataset: {}'.format(name))
    return __sets[name]()

def list_imdbs():
    """List all registered imdbs."""
    return __sets.keys()
コード例 #4
0
ファイル: factory.py プロジェクト: JRCondeNast/tf-faster-rcnn
for categories in categories_lists:
 for split in ['train','val']:
      train_dir = './data/visual_genome/' + categories + '_train'
      val_dir = './data/visual_genome/' + categories + '_val'

      train_list, val_list = vg_instance.train_val_splitting(0.7, eval(categories))
      if not os.path.exists(train_dir):
            os.system('mkdir ' + train_dir)
            for f in train_list:
                os.system('cp ' + vg_path + '/images/' + str(f) + '.jpg ' + train_dir)
      if not os.path.exists(val_dir):
            os.system('mkdir ' + val_dir)
            for f in val_list:
                os.system('cp ' + vg_path + '/images/' + str(f) + '.jpg ' + val_dir)
      name = 'visual_genome_{}_{}'.format(categories,split)
      __sets[name] = (lambda split=split, categories=categories: visual_genome(categories, eval(categories), split))




def get_imdb(name):
  """Get an imdb (image database) by name."""
  if name not in __sets:
    raise KeyError('Unknown dataset: {}'.format(name))
  return __sets[name]()


def list_imdbs():
  """List all registered imdbs."""
  return list(__sets.keys())
コード例 #5
0
        name = 'coco_{}_{}'.format(year, split)
        __sets[name] = (lambda split=split, year=year: coco(split, year))

# Set up coco_2015_<split>
for year in ['2015']:
    for split in ['test', 'test-dev']:
        name = 'coco_{}_{}'.format(year, split)
        __sets[name] = (lambda split=split, year=year: coco(split, year))

# Set up ade_<split>_5
for split in ['train', 'val', 'mval', 'mtest']:
    name = 'ade_{}_5'.format(split)
    __sets[name] = (lambda split=split: ade(split))

# Set up vg_<split>_5,10
for split in ['train', 'val', 'test']:
    name = 'visual_genome_{}_5'.format(split)
    __sets[name] = (lambda split=split: visual_genome(split))


def get_imdb(name):
    """Get an imdb (image database) by name."""
    if name not in __sets:
        raise KeyError('Unknown dataset: {}'.format(name))
    return __sets[name]()


def list_imdbs():
    """List all registered imdbs."""
    return list(__sets.keys())