Module vipy.data.food101
Expand source code Browse git
import os
import vipy
URL = 'http://data.vision.ee.ethz.ch/cvl/food-101.tar.gz'
SHA1 = None
class Food101(vipy.dataset.Dataset):
"""Project: https://data.vision.ee.ethz.ch/cvl/datasets_extra/food-101/"""
def __init__(self, datadir):
# Download
self._datadir = vipy.util.remkdir(datadir)
if not os.path.exists(os.path.join(self._datadir, 'food-101.tar.gz')):
vipy.downloader.download_and_unpack(URL, self._datadir, sha1=SHA1)
imlist = [vipy.image.ImageCategory(filename=f, category=vipy.util.filebase(vipy.util.filepath(f))) for f in vipy.util.findimages(os.path.join(datadir, 'food-101'))]
super().__init__(imlist, id='food101')
Classes
class Food101 (datadir)
-
Expand source code Browse git
class Food101(vipy.dataset.Dataset): """Project: https://data.vision.ee.ethz.ch/cvl/datasets_extra/food-101/""" def __init__(self, datadir): # Download self._datadir = vipy.util.remkdir(datadir) if not os.path.exists(os.path.join(self._datadir, 'food-101.tar.gz')): vipy.downloader.download_and_unpack(URL, self._datadir, sha1=SHA1) imlist = [vipy.image.ImageCategory(filename=f, category=vipy.util.filebase(vipy.util.filepath(f))) for f in vipy.util.findimages(os.path.join(datadir, 'food-101'))] super().__init__(imlist, id='food101')
Ancestors
Inherited members
Dataset
:archive
categories
chunk
class_to_index
classes
classlist
clone
count
countby
density
duration_in_seconds
filter
flatten
id
index_to_class
inverse_frequency_weight
istype
jsondir
label_to_index
list
load
map
merge
minibatch
multilabel_inverse_frequency_weight
num_categories
num_classes
num_labels
percentage
replace
save
set
shuffle
shuffler
sort
split
split_by_videoid
synonym
take
take_per_category
takefilter
takelist
takeone
to_torch
to_torch_tensordir
tohtml
tojsondir
tolist
video_duration_in_seconds
video_montage
zip