easycv.datasets.classification.data_sources package

class easycv.datasets.classification.data_sources.ClsSourceCifar10(root, split)[source]

Bases: object

CLASSES = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']
__init__(root, split)[source]

Initialize self. See help(type(self)) for accurate signature.

get_length()[source]
get_sample(idx)[source]
class easycv.datasets.classification.data_sources.ClsSourceCifar100(root, split)[source]

Bases: object

CLASSES = None
__init__(root, split)[source]

Initialize self. See help(type(self)) for accurate signature.

get_length()[source]
get_sample(idx)[source]
class easycv.datasets.classification.data_sources.ClsSourceImageListByClass(root, list_file, m_per_class=2, delimeter=' ', split_huge_listfile_byrank=False, cache_path='data/', max_try=20)[source]

Bases: object

Get the same m_per_class samples by the label idx.

Parameters
  • list_file – str / list(str), str means a input image list file path, this file contains records as image_path label in list_file list(str) means multi image list, each one contains some records as image_path label

  • root – str / list(str), root path for image_path, each list_file will need a root.

  • m_per_class – num of samples for each class.

  • delimeter – str, delimeter of each line in the list_file

  • split_huge_listfile_byrank – Adapt to the situation that the memory cannot fully load a huge amount of data list. If split, data list will be split to each rank.

  • cache_path – if split_huge_listfile_byrank is true, cache list_file will be saved to cache_path.

  • max_try – int, max try numbers of reading image

__init__(root, list_file, m_per_class=2, delimeter=' ', split_huge_listfile_byrank=False, cache_path='data/', max_try=20)[source]

Initialize self. See help(type(self)) for accurate signature.

get_length()[source]
get_sample(idx)[source]
class easycv.datasets.classification.data_sources.ClsSourceImageList(list_file, root='', delimeter=' ', split_huge_listfile_byrank=False, split_label_balance=False, cache_path='data/', max_try=20)[source]

Bases: object

data source for classification

Parameters
  • list_file – str / list(str), str means a input image list file path, this file contains records as image_path label in list_file list(str) means multi image list, each one contains some records as image_path label

  • root – str / list(str), root path for image_path, each list_file will need a root, if len(root) < len(list_file), we will use root[-1] to fill root list.

  • delimeter – str, delimeter of each line in the list_file

  • split_huge_listfile_byrank – Adapt to the situation that the memory cannot fully load a huge amount of data list. If split, data list will be split to each rank.

  • split_label_balance – if split_huge_listfile_byrank is true, whether split with label balance

  • cache_path – if split_huge_listfile_byrank is true, cache list_file will be saved to cache_path.

  • max_try – int, max try numbers of reading image

__init__(list_file, root='', delimeter=' ', split_huge_listfile_byrank=False, split_label_balance=False, cache_path='data/', max_try=20)[source]

Initialize self. See help(type(self)) for accurate signature.

static parse_list_file(list_file, root, delimeter)[source]
get_length()[source]
get_sample(idx)[source]
class easycv.datasets.classification.data_sources.ClsSourceImageNetTFRecord(list_file='', root='', file_pattern=None, cache_path='data/cache/', max_try=10)[source]

Bases: object

data source for imagenet tfrecord.

__init__(list_file='', root='', file_pattern=None, cache_path='data/cache/', max_try=10)[source]

Initialize self. See help(type(self)) for accurate signature.

Submodules

easycv.datasets.classification.data_sources.cifar module

class easycv.datasets.classification.data_sources.cifar.ClsSourceCifar10(root, split)[source]

Bases: object

CLASSES = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']
__init__(root, split)[source]

Initialize self. See help(type(self)) for accurate signature.

get_length()[source]
get_sample(idx)[source]
class easycv.datasets.classification.data_sources.cifar.ClsSourceCifar100(root, split)[source]

Bases: object

CLASSES = None
__init__(root, split)[source]

Initialize self. See help(type(self)) for accurate signature.

get_length()[source]
get_sample(idx)[source]

easycv.datasets.classification.data_sources.class_list module

class easycv.datasets.classification.data_sources.class_list.ClsSourceImageListByClass(root, list_file, m_per_class=2, delimeter=' ', split_huge_listfile_byrank=False, cache_path='data/', max_try=20)[source]

Bases: object

Get the same m_per_class samples by the label idx.

Parameters
  • list_file – str / list(str), str means a input image list file path, this file contains records as image_path label in list_file list(str) means multi image list, each one contains some records as image_path label

  • root – str / list(str), root path for image_path, each list_file will need a root.

  • m_per_class – num of samples for each class.

  • delimeter – str, delimeter of each line in the list_file

  • split_huge_listfile_byrank – Adapt to the situation that the memory cannot fully load a huge amount of data list. If split, data list will be split to each rank.

  • cache_path – if split_huge_listfile_byrank is true, cache list_file will be saved to cache_path.

  • max_try – int, max try numbers of reading image

__init__(root, list_file, m_per_class=2, delimeter=' ', split_huge_listfile_byrank=False, cache_path='data/', max_try=20)[source]

Initialize self. See help(type(self)) for accurate signature.

get_length()[source]
get_sample(idx)[source]

easycv.datasets.classification.data_sources.fashiongen_h5 module

class easycv.datasets.classification.data_sources.fashiongen_h5.FashionGenH5(h5file_path, return_label=True, cache_path='data/fashionGenH5')[source]

Bases: object

__init__(h5file_path, return_label=True, cache_path='data/fashionGenH5')[source]

Initialize self. See help(type(self)) for accurate signature.

get_length()[source]
get_sample(idx)[source]

easycv.datasets.classification.data_sources.image_list module

class easycv.datasets.classification.data_sources.image_list.ClsSourceImageList(list_file, root='', delimeter=' ', split_huge_listfile_byrank=False, split_label_balance=False, cache_path='data/', max_try=20)[source]

Bases: object

data source for classification

Parameters
  • list_file – str / list(str), str means a input image list file path, this file contains records as image_path label in list_file list(str) means multi image list, each one contains some records as image_path label

  • root – str / list(str), root path for image_path, each list_file will need a root, if len(root) < len(list_file), we will use root[-1] to fill root list.

  • delimeter – str, delimeter of each line in the list_file

  • split_huge_listfile_byrank – Adapt to the situation that the memory cannot fully load a huge amount of data list. If split, data list will be split to each rank.

  • split_label_balance – if split_huge_listfile_byrank is true, whether split with label balance

  • cache_path – if split_huge_listfile_byrank is true, cache list_file will be saved to cache_path.

  • max_try – int, max try numbers of reading image

__init__(list_file, root='', delimeter=' ', split_huge_listfile_byrank=False, split_label_balance=False, cache_path='data/', max_try=20)[source]

Initialize self. See help(type(self)) for accurate signature.

static parse_list_file(list_file, root, delimeter)[source]
get_length()[source]
get_sample(idx)[source]

easycv.datasets.classification.data_sources.imagenet_tfrecord module

class easycv.datasets.classification.data_sources.imagenet_tfrecord.ClsSourceImageNetTFRecord(list_file='', root='', file_pattern=None, cache_path='data/cache/', max_try=10)[source]

Bases: object

data source for imagenet tfrecord.

__init__(list_file='', root='', file_pattern=None, cache_path='data/cache/', max_try=10)[source]

Initialize self. See help(type(self)) for accurate signature.

easycv.datasets.classification.data_sources.utils module

easycv.datasets.classification.data_sources.utils.split_listfile_byrank(list_file, label_balance, save_path='data/', delimeter=' ')[source]