easycv.datasets.classification package¶
- class easycv.datasets.classification.ClsDataset(data_source, pipeline)[source]¶
Bases:
Generic
[torch.utils.data.dataset.T_co
]Dataset for classification
- Parameters
data_source – data source to parse input data
pipeline – transforms list
- __init__(data_source, pipeline)[source]¶
Initialize self. See help(type(self)) for accurate signature.
- evaluate(results, evaluators, logger=None, topk=(1, 5))[source]¶
evaluate classification task
- Parameters
results – a dict of list of tensor, including prediction and groundtruth info, where prediction tensor is NxC,and the same with groundtruth labels.
evaluators – a list of evaluator
- Returns
a dict of float, different metric values
- Return type
eval_result
- visualize(results, vis_num=10, **kwargs)[source]¶
Visulaize the model output on validation data. :param results: A dictionary containing
class: List of length number of test images. img_metas: List of length number of test images,
dict of image meta info, containing filename, img_shape, origin_img_shape and so on.
- Parameters
vis_num – number of images visualized
- Returns: A dictionary containing
images: Visulaized images, list of np.ndarray. img_metas: List of length number of test images,
dict of image meta info, containing filename, img_shape, origin_img_shape and so on.
- class easycv.datasets.classification.ClsOdpsDataset(data_source, pipeline, image_key='url_image', label_key='label', **kwargs)[source]¶
Bases:
Generic
[torch.utils.data.dataset.T_co
]Dataset for rotation prediction
Subpackages¶
- easycv.datasets.classification.data_sources package
- Submodules
- easycv.datasets.classification.data_sources.cifar module
- easycv.datasets.classification.data_sources.class_list module
- easycv.datasets.classification.data_sources.fashiongen_h5 module
- easycv.datasets.classification.data_sources.image_list module
- easycv.datasets.classification.data_sources.imagenet_tfrecord module
- easycv.datasets.classification.data_sources.utils module
- easycv.datasets.classification.pipelines package
Submodules¶
easycv.datasets.classification.odps module¶
- class easycv.datasets.classification.odps.ClsOdpsDataset(data_source, pipeline, image_key='url_image', label_key='label', **kwargs)[source]¶
Bases:
Generic
[torch.utils.data.dataset.T_co
]Dataset for rotation prediction
easycv.datasets.classification.raw module¶
- class easycv.datasets.classification.raw.ClsDataset(data_source, pipeline)[source]¶
Bases:
Generic
[torch.utils.data.dataset.T_co
]Dataset for classification
- Parameters
data_source – data source to parse input data
pipeline – transforms list
- __init__(data_source, pipeline)[source]¶
Initialize self. See help(type(self)) for accurate signature.
- evaluate(results, evaluators, logger=None, topk=(1, 5))[source]¶
evaluate classification task
- Parameters
results – a dict of list of tensor, including prediction and groundtruth info, where prediction tensor is NxC,and the same with groundtruth labels.
evaluators – a list of evaluator
- Returns
a dict of float, different metric values
- Return type
eval_result
- visualize(results, vis_num=10, **kwargs)[source]¶
Visulaize the model output on validation data. :param results: A dictionary containing
class: List of length number of test images. img_metas: List of length number of test images,
dict of image meta info, containing filename, img_shape, origin_img_shape and so on.
- Parameters
vis_num – number of images visualized
- Returns: A dictionary containing
images: Visulaized images, list of np.ndarray. img_metas: List of length number of test images,
dict of image meta info, containing filename, img_shape, origin_img_shape and so on.