Spaces:
Runtime error
Runtime error
# Copyright (c) OpenMMLab. All rights reserved. | |
from typing import Optional, Union | |
from mmpretrain.registry import DATASETS | |
from .categories import PLACES205_CATEGORIES | |
from .custom import CustomDataset | |
class Places205(CustomDataset): | |
"""`Places205 <http://places.csail.mit.edu/downloadData.html>`_ Dataset. | |
Args: | |
data_root (str): The root directory for ``data_prefix`` and | |
``ann_file``. Defaults to ''. | |
data_prefix (str | dict): Prefix for training data. Defaults | |
to ''. | |
ann_file (str): Annotation file path. Defaults to ''. | |
metainfo (dict, optional): Meta information for dataset, such as class | |
information. Defaults to None. | |
**kwargs: Other keyword arguments in :class:`CustomDataset` and | |
:class:`BaseDataset`. | |
""" | |
IMG_EXTENSIONS = ('.jpg', '.jpeg', '.png', '.ppm', '.bmp', '.pgm', '.tif') | |
METAINFO = {'classes': PLACES205_CATEGORIES} | |
def __init__(self, | |
data_root: str = '', | |
data_prefix: Union[str, dict] = '', | |
ann_file: str = '', | |
metainfo: Optional[dict] = None, | |
**kwargs): | |
kwargs = {'extensions': self.IMG_EXTENSIONS, **kwargs} | |
super().__init__( | |
data_root=data_root, | |
data_prefix=data_prefix, | |
ann_file=ann_file, | |
metainfo=metainfo, | |
**kwargs) | |