Datasets:
michelecafagna26
commited on
Commit
•
cb85080
1
Parent(s):
b87a5ec
Update hl.py
Browse files
hl.py
CHANGED
@@ -33,7 +33,10 @@ _HOMEPAGE = ""
|
|
33 |
_LICENSE = "Apache 2.0"
|
34 |
|
35 |
#_URL = "https://huggingface.co/datasets/michelecafagna26/hl/main/data/images.zip"
|
36 |
-
|
|
|
|
|
|
|
37 |
|
38 |
|
39 |
class HL(datasets.GeneratorBasedBuilder):
|
@@ -83,19 +86,20 @@ class HL(datasets.GeneratorBasedBuilder):
|
|
83 |
)
|
84 |
|
85 |
def _split_generators(self, dl_manager):
|
86 |
-
|
|
|
87 |
return [
|
88 |
datasets.SplitGenerator(
|
89 |
name=datasets.Split.TRAIN,
|
90 |
gen_kwargs={
|
91 |
-
"annotation_file_path":
|
92 |
"images": dl_manager.iter_archive(archive),
|
93 |
},
|
94 |
),
|
95 |
datasets.SplitGenerator(
|
96 |
name=datasets.Split.TEST,
|
97 |
gen_kwargs={
|
98 |
-
"annotation_file_path":
|
99 |
"images": dl_manager.iter_archive(archive),
|
100 |
},
|
101 |
),
|
|
|
33 |
_LICENSE = "Apache 2.0"
|
34 |
|
35 |
#_URL = "https://huggingface.co/datasets/michelecafagna26/hl/main/data/images.zip"
|
36 |
+
_IMG = "https://huggingface.co/datasets/michelecafagna26/hl/blob/main/data/images.zip"
|
37 |
+
_TRAIN = "https://huggingface.co/datasets/michelecafagna26/hl/blob/main/data/annotations/train.jsonl"
|
38 |
+
_TEST = "https://huggingface.co/datasets/michelecafagna26/hl/blob/main/data/annotations/test.jsonl"
|
39 |
+
|
40 |
|
41 |
|
42 |
class HL(datasets.GeneratorBasedBuilder):
|
|
|
86 |
)
|
87 |
|
88 |
def _split_generators(self, dl_manager):
|
89 |
+
image_files = dl_manager.download(_IMG)
|
90 |
+
annotation_files = dl_manager.download_and_extract([_TRAIN, _TEST])
|
91 |
return [
|
92 |
datasets.SplitGenerator(
|
93 |
name=datasets.Split.TRAIN,
|
94 |
gen_kwargs={
|
95 |
+
"annotation_file_path": annotation_files[0],
|
96 |
"images": dl_manager.iter_archive(archive),
|
97 |
},
|
98 |
),
|
99 |
datasets.SplitGenerator(
|
100 |
name=datasets.Split.TEST,
|
101 |
gen_kwargs={
|
102 |
+
"annotation_file_path": annotation_files[1],
|
103 |
"images": dl_manager.iter_archive(archive),
|
104 |
},
|
105 |
),
|