Upload movingthings.py
Browse files- movingthings.py +13 -2
movingthings.py
CHANGED
|
@@ -39,10 +39,21 @@ class MovingThings(datasets.GeneratorBasedBuilder):
|
|
| 39 |
|
| 40 |
def _split_generators(self, dl_manager):
|
| 41 |
return {
|
| 42 |
-
"train": self._generate_examples(
|
| 43 |
-
# Add other splits like "validation" and "test" if needed
|
| 44 |
}
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
# Task template outside of _info()
|
| 47 |
MovingThingsTaskTemplate = ImageClassification(image_column="image", label_column="labels")
|
| 48 |
|
|
|
|
| 39 |
|
| 40 |
def _split_generators(self, dl_manager):
|
| 41 |
return {
|
| 42 |
+
"train": self._generate_examples(),
|
|
|
|
| 43 |
}
|
| 44 |
|
| 45 |
+
def _generate_examples(self):
|
| 46 |
+
# Implement your example generation logic here
|
| 47 |
+
# Return a list of dictionaries containing the features for each example
|
| 48 |
+
# You can simulate example data generation here
|
| 49 |
+
examples = [{"file_name": "soccer-ball-0.png", "text": "there is a man that is standing in the dark with a cell phone", "labels":"roll"},
|
| 50 |
+
{"file_name": "sled-1.png", "text": "there is a red chair that is sitting on the sidewalk", "labels":"roll"},
|
| 51 |
+
{"file_name": "steamroller-2.png", "text": "there is a large yellow pipe laying on the ground next to a yellow pole", "labels":"roll"},
|
| 52 |
+
{"file_name": "hamster-wheel-3.png", "text": "there is a large circular sculpture made of colored plastic", "labels":"roll"},
|
| 53 |
+
{"file_name": "skateboard-4.png", "text": "there is a skateboard that is laying on the ground", "labels":"roll"}]
|
| 54 |
+
return examples
|
| 55 |
+
|
| 56 |
+
|
| 57 |
# Task template outside of _info()
|
| 58 |
MovingThingsTaskTemplate = ImageClassification(image_column="image", label_column="labels")
|
| 59 |
|