karolyartur
commited on
Commit
·
80b8f8f
1
Parent(s):
e6109e1
Use huggingface_hub to list all tar files
Browse files
SMVB.py
CHANGED
@@ -29,6 +29,7 @@ from typing import Optional, IO
|
|
29 |
|
30 |
import datasets
|
31 |
import itertools
|
|
|
32 |
|
33 |
|
34 |
# ---- Constants ----
|
@@ -54,11 +55,11 @@ _HOMEPAGE = "https://huggingface.co/ABC-iRobotics/SMVB"
|
|
54 |
|
55 |
_LICENSE = "GNU General Public License v3.0"
|
56 |
|
57 |
-
_BASE_URL = "https://huggingface.co/
|
|
|
|
|
58 |
|
59 |
-
_VERSION =
|
60 |
-
|
61 |
-
_SCENES = ['car']
|
62 |
|
63 |
|
64 |
# ---- SMVB dataset Configs ----
|
@@ -66,9 +67,11 @@ _SCENES = ['car']
|
|
66 |
class SMVBDatasetConfig(datasets.BuilderConfig):
|
67 |
"""BuilderConfig for SMVB dataset."""
|
68 |
|
69 |
-
def __init__(self, name: str,
|
70 |
super(SMVBDatasetConfig, self).__init__(version=datasets.Version(version), name=name, **kwargs)
|
71 |
-
|
|
|
|
|
72 |
|
73 |
@property
|
74 |
def features(self):
|
@@ -97,8 +100,7 @@ class SMVBDataset(datasets.GeneratorBasedBuilder):
|
|
97 |
BUILDER_CONFIGS = [
|
98 |
SMVBDatasetConfig(
|
99 |
name = "all",
|
100 |
-
description = "
|
101 |
-
data_urls = [_BASE_URL + '/' + s + '.tar.gz' for s in _SCENES],
|
102 |
version = _VERSION
|
103 |
),
|
104 |
]
|
|
|
29 |
|
30 |
import datasets
|
31 |
import itertools
|
32 |
+
from huggingface_hub import HfFileSystem
|
33 |
|
34 |
|
35 |
# ---- Constants ----
|
|
|
55 |
|
56 |
_LICENSE = "GNU General Public License v3.0"
|
57 |
|
58 |
+
_BASE_URL = "https://huggingface.co/"
|
59 |
+
_REPO = "datasets/ABC-iRobotics/SMVB"
|
60 |
+
_RESOURCE = "/resolve/main"
|
61 |
|
62 |
+
_VERSION = "1.0.0"
|
|
|
|
|
63 |
|
64 |
|
65 |
# ---- SMVB dataset Configs ----
|
|
|
67 |
class SMVBDatasetConfig(datasets.BuilderConfig):
|
68 |
"""BuilderConfig for SMVB dataset."""
|
69 |
|
70 |
+
def __init__(self, name: str, version: Optional[str] = None, **kwargs):
|
71 |
super(SMVBDatasetConfig, self).__init__(version=datasets.Version(version), name=name, **kwargs)
|
72 |
+
fs = HfFileSystem()
|
73 |
+
tarfiles = sorted(fs.glob(_REPO + "/**.tar.gz"))
|
74 |
+
self._data_urls = [p.replace(_REPO,_BASE_URL+_REPO+_RESOURCE) for p in tarfiles]
|
75 |
|
76 |
@property
|
77 |
def features(self):
|
|
|
100 |
BUILDER_CONFIGS = [
|
101 |
SMVBDatasetConfig(
|
102 |
name = "all",
|
103 |
+
description = "Synthetic data with rich annotations",
|
|
|
104 |
version = _VERSION
|
105 |
),
|
106 |
]
|