jamescalam
commited on
Commit
•
4f1d9ee
1
Parent(s):
e49fb21
Update shrek-detection.py
Browse files- shrek-detection.py +10 -0
shrek-detection.py
CHANGED
@@ -36,8 +36,12 @@ class ImageSet(datasets.GeneratorBasedBuilder):
|
|
36 |
)
|
37 |
|
38 |
def _split_generators(self, dl_manager):
|
|
|
39 |
images_archive = dl_manager.download(f"{_REPO}/resolve/main/images.tgz")
|
40 |
image_iters = dl_manager.iter_archive(images_archive)
|
|
|
|
|
|
|
41 |
return [
|
42 |
datasets.SplitGenerator(
|
43 |
name=datasets.Split.TRAIN,
|
@@ -45,6 +49,12 @@ class ImageSet(datasets.GeneratorBasedBuilder):
|
|
45 |
"images": image_iters
|
46 |
}
|
47 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
]
|
49 |
|
50 |
def _generate_examples(self, images):
|
|
|
36 |
)
|
37 |
|
38 |
def _split_generators(self, dl_manager):
|
39 |
+
# iterator for train set
|
40 |
images_archive = dl_manager.download(f"{_REPO}/resolve/main/images.tgz")
|
41 |
image_iters = dl_manager.iter_archive(images_archive)
|
42 |
+
# iterator for test set
|
43 |
+
test_images_archive = dl_manager.download(f"{_REPO}/resolve/main/test_images.tgz")
|
44 |
+
test_image_iters = dl_manager.iter_archive(test_images_archive)
|
45 |
return [
|
46 |
datasets.SplitGenerator(
|
47 |
name=datasets.Split.TRAIN,
|
|
|
49 |
"images": image_iters
|
50 |
}
|
51 |
),
|
52 |
+
datasets.SplitGenerator(
|
53 |
+
name=datasets.Split.TEST,
|
54 |
+
gen_kwargs={
|
55 |
+
"images": test_image_iters
|
56 |
+
}
|
57 |
+
),
|
58 |
]
|
59 |
|
60 |
def _generate_examples(self, images):
|