|
9 | 9 | Filter,
|
10 | 10 | IterKeyZipper,
|
11 | 11 | )
|
12 |
| -from torchvision.prototype.datasets.utils import Dataset2, DatasetInfo, HttpResource, OnlineResource |
| 12 | +from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource |
13 | 13 | from torchvision.prototype.datasets.utils._internal import (
|
14 | 14 | INFINITE_BUFFER_SIZE,
|
15 | 15 | read_mat,
|
16 | 16 | hint_sharding,
|
17 | 17 | hint_shuffling,
|
18 |
| - BUILTIN_DIR, |
| 18 | + read_categories_file, |
19 | 19 | )
|
20 | 20 | from torchvision.prototype.features import Label, BoundingBox, _Feature, EncodedImage
|
21 | 21 |
|
22 | 22 | from .._api import register_dataset, register_info
|
23 | 23 |
|
24 | 24 |
|
25 |
| -CALTECH101_CATEGORIES, *_ = zip(*DatasetInfo.read_categories_file(BUILTIN_DIR / "caltech101.categories")) |
26 |
| - |
27 |
| - |
28 | 25 | @register_info("caltech101")
|
29 | 26 | def _caltech101_info() -> Dict[str, Any]:
|
30 |
| - return dict(categories=CALTECH101_CATEGORIES) |
| 27 | + return dict(categories=read_categories_file("caltech101")) |
31 | 28 |
|
32 | 29 |
|
33 | 30 | @register_dataset("caltech101")
|
34 |
| -class Caltech101(Dataset2): |
| 31 | +class Caltech101(Dataset): |
35 | 32 | """
|
36 | 33 | - **homepage**: http://www.vision.caltech.edu/Image_Datasets/Caltech101
|
37 | 34 | - **dependencies**:
|
@@ -152,16 +149,13 @@ def _generate_categories(self) -> List[str]:
|
152 | 149 | return sorted({pathlib.Path(path).parent.name for path, _ in dp})
|
153 | 150 |
|
154 | 151 |
|
155 |
| -CALTECH256_CATEGORIES, *_ = zip(*DatasetInfo.read_categories_file(BUILTIN_DIR / "caltech256.categories")) |
156 |
| - |
157 |
| - |
158 | 152 | @register_info("caltech256")
|
159 | 153 | def _caltech256_info() -> Dict[str, Any]:
|
160 |
| - return dict(categories=CALTECH256_CATEGORIES) |
| 154 | + return dict(categories=read_categories_file("caltech256")) |
161 | 155 |
|
162 | 156 |
|
163 | 157 | @register_dataset("caltech256")
|
164 |
| -class Caltech256(Dataset2): |
| 158 | +class Caltech256(Dataset): |
165 | 159 | """
|
166 | 160 | - **homepage**: http://www.vision.caltech.edu/Image_Datasets/Caltech256
|
167 | 161 | """
|
|
0 commit comments