def __init__(self, root, verbose=True): """ ctro """ Dataset.__init__(self, "egohands_data", root, verbose) url = 'http://vision.soic.indiana.edu/egohands_files/egohands_data.zip' self.root_export = join(root, "egohands_data") self.download_and_unzip(url)
def __init__(self, root, verbose=True): """ create a hand dataset """ Dataset.__init__(self, "hand_dataset", root, verbose) url = 'http://www.robots.ox.ac.uk/~vgg/data/hands/downloads/hand_dataset.tar.gz' #self.root_export = join(root, "lspe") self.download_and_unzip(url, zipfile_name='hand_dataset.tar.gz') self.root_export = join(root, "hand_dataset")
def __init__(self, root, root_export, name, url, verbose=True, resize=None): Dataset.__init__(self, name, root, verbose) self.root_export = root_export self.download_and_unzip(url) self.resize = resize
def __init__(self, root, verbose=True, force_shape=None, memmapped=True): Dataset.__init__(self, "DukeMTMC-reID", root, verbose) Dataset.unzip(self) self.root_export = join(root, "DukeMTMC-reID") self.memmapped = memmapped if force_shape is None: self.force_shape = None else: assert len(force_shape) == 2 w, h = force_shape self.force_shape = (h, w) # as resize used inversed logic..
def __init__(self, root, verbose=True): Dataset.__init__(self, 'mpii_human_pose_v1', root, verbose) url_data = 'http://datasets.d2.mpi-inf.mpg.de/andriluka14cvpr/mpii_human_pose_v1.tar.gz' url_anno = 'http://datasets.d2.mpi-inf.mpg.de/andriluka14cvpr/mpii_human_pose_v1_u12_2.zip' self.download_and_unzip(url_anno, zipfile_name='mpii_human_pose_v1_u12_2.zip', dest_folder='mpii_human_pose_v1_u12_2') self.root_export = join(root, 'mpii_human_pose_v1_u12_2') self.download_and_unzip(url_data, zipfile_name='mpii_human_pose_v1.tar.gz', dest_folder=join('mpii_human_pose_v1_u12_2', 'images')) # -- load images -- mpii_root = self.root_export img_dir = join(mpii_root, 'images/images') assert isdir(img_dir) n = len(listdir(img_dir)) fmmap = join(mpii_root, 'X.npy') flookup = join(mpii_root, 'lookup.pkl') lookup = [] if not isfile(fmmap): assert not isfile(flookup) X = np.memmap(fmmap, dtype='uint8', mode='w+', shape=(n, 1080, 1920, 3)) for idx, f in enumerate(sorted(listdir(img_dir))): if idx % 100 == 0: print(str(idx) + '/' + str(n)) I = imread(join(img_dir, f)) h,w,_ = I.shape X[idx,0:h,0:w,:] = I lookup.append((f,h,w)) with open(flookup, 'wb') as f: pkl.dump(lookup, f) del X # flush data self.X = np.memmap(fmmap, dtype='uint8', mode='r', shape=(n, 1080, 1920, 3)) with open(flookup, 'rb') as f: self.lookup = pkl.load(f)
def __init__(self, root, verbose=True, target_w=100, target_h=256, memmapped=True): """ create cuhk03 dataset root: data folder that stores all files verbose: boolean flag to tell if the class should talk in debug mode or not target_w: resize all images to fit target_w target_h: resize all images to fit target_h """ Dataset.__init__(self, "cuhk03_release", root, verbose) Dataset.unzip(self) self.hd5file = join(join(root, self.name), 'cuhk-03.mat') self.memmapped_file_location = join(root, self.name) self.target_w = int(target_w) self.target_h = int(target_h) self.memmapped = memmapped
def __init__(self, root, verbose=True, force_shape=None, memmapped=True): """ force_shape: (w,h) if set the images will be forced into a given shape """ url = 'http://188.138.127.15:81/Datasets/Market-1501-v15.09.15.zip' Dataset.__init__(self, "Market-1501-v15.09.15", root, verbose) self.download_and_unzip(url) self.root_export = join(root, "Market-1501-v15.09.15") # depending on OS / unzip version / full moon the folder might be 'doubly' # nested ... nested_root = join(self.root_export, "Market-1501-v15.09.15") if isdir(nested_root): self.root_export = nested_root self.memmapped = memmapped if force_shape is None: self.force_shape = None else: assert len(force_shape) == 2 w,h = force_shape self.force_shape = (h, w) # as resize used inversed logic..
def __init__(self, root, verbose=True): Dataset.__init__(self, 'marconi', root, verbose) utils.talk('(MARCOnl)', verbose) # This is a horrible hack but it seems that # the python tools cannot unzip certain zip files # (that seem to be zipped on OSX) and I have no # time to find a 'good' solution so the ugly hack # is: use the system tools which for some reason # work! (on LINUX!!) --> see MARCOnI self.force_unzip_with_os_tools = True self._verbose = verbose self.root_export = join(root, 'marconi') self.download_set("Soccer") self.download_set("Kickbox") self.download_set("SBoard") self.download_set("Soccer2") self.download_set("Walk1") self.download_set("Walk2") self.download_set("Volleyball") self.download_set("Juggling") self.download_set("Run2")
def __init__(self, root, verbose=True): Dataset.__init__(self, 'lspe', root, verbose) url = 'http://sam.johnson.io/research/lspet_dataset.zip' self.root_export = join(root, "lspe") self.download_and_unzip(url)