Commit ·
533e190
1
Parent(s): d4ec9f0
Update README and fix loading script
Browse files- README.md +36 -0
- uc_merced_land_use.py +5 -6
README.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
| 1 |
---
|
| 2 |
license: cc0-1.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
| 1 |
---
|
| 2 |
license: cc0-1.0
|
| 3 |
+
dataset_info:
|
| 4 |
+
config_name: ucmerced_landuse
|
| 5 |
+
features:
|
| 6 |
+
- name: img
|
| 7 |
+
dtype: image
|
| 8 |
+
- name: label
|
| 9 |
+
dtype:
|
| 10 |
+
class_label:
|
| 11 |
+
names:
|
| 12 |
+
'0': agricultural
|
| 13 |
+
'1': airplane
|
| 14 |
+
'2': baseballdiamond
|
| 15 |
+
'3': beach
|
| 16 |
+
'4': buildings
|
| 17 |
+
'5': chaparral
|
| 18 |
+
'6': denseresidential
|
| 19 |
+
'7': forest
|
| 20 |
+
'8': freeway
|
| 21 |
+
'9': golfcourse
|
| 22 |
+
'10': harbor
|
| 23 |
+
'11': intersection
|
| 24 |
+
'12': mediumresidential
|
| 25 |
+
'13': mobilehomepark
|
| 26 |
+
'14': overpass
|
| 27 |
+
'15': parkinglot
|
| 28 |
+
'16': river
|
| 29 |
+
'17': runway
|
| 30 |
+
'18': sparseresidential
|
| 31 |
+
'19': storagetanks
|
| 32 |
+
'20': tenniscourt
|
| 33 |
+
splits:
|
| 34 |
+
- name: train
|
| 35 |
+
num_bytes: 406563
|
| 36 |
+
num_examples: 2100
|
| 37 |
+
download_size: 332468434
|
| 38 |
+
dataset_size: 406563
|
| 39 |
---
|
uc_merced_land_use.py
CHANGED
|
@@ -131,11 +131,7 @@ class UCMercedLandUse(datasets.GeneratorBasedBuilder):
|
|
| 131 |
)
|
| 132 |
|
| 133 |
def _split_generators(self, dl_manager):
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
script_dir = os.path.dirname(os.path.abspath(__file__))
|
| 137 |
-
archive_path = os.path.join(script_dir, "UCMerced_LandUse.zip")
|
| 138 |
-
data_dir = dl_manager.extract(archive_path)
|
| 139 |
|
| 140 |
class_dirs = [
|
| 141 |
os.path.join(data_dir, "UCMerced_LandUse/Images", label)
|
|
@@ -153,7 +149,8 @@ class UCMercedLandUse(datasets.GeneratorBasedBuilder):
|
|
| 153 |
]
|
| 154 |
|
| 155 |
def _generate_examples(self, class_dirs, split):
|
| 156 |
-
|
|
|
|
| 157 |
class_label = os.path.basename(class_dir)
|
| 158 |
|
| 159 |
# Iterate through the images in the class directory
|
|
@@ -164,3 +161,5 @@ class UCMercedLandUse(datasets.GeneratorBasedBuilder):
|
|
| 164 |
"img": image_path,
|
| 165 |
"label": class_label,
|
| 166 |
}
|
|
|
|
|
|
|
|
|
| 131 |
)
|
| 132 |
|
| 133 |
def _split_generators(self, dl_manager):
|
| 134 |
+
data_dir = dl_manager.download_and_extract("UCMerced_LandUse.zip")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
|
| 136 |
class_dirs = [
|
| 137 |
os.path.join(data_dir, "UCMerced_LandUse/Images", label)
|
|
|
|
| 149 |
]
|
| 150 |
|
| 151 |
def _generate_examples(self, class_dirs, split):
|
| 152 |
+
key = 0
|
| 153 |
+
for class_dir in class_dirs:
|
| 154 |
class_label = os.path.basename(class_dir)
|
| 155 |
|
| 156 |
# Iterate through the images in the class directory
|
|
|
|
| 161 |
"img": image_path,
|
| 162 |
"label": class_label,
|
| 163 |
}
|
| 164 |
+
|
| 165 |
+
key += 1
|