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']¶
- class easycv.datasets.classification.data_sources.ClsSourceCifar100(root, split)[source]¶
Bases:
object
- CLASSES = None¶
- 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
- 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
- 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.
Submodules¶
easycv.datasets.classification.data_sources.cifar module¶
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
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
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