martingrzzler
commited on
Commit
•
9e6a0f5
1
Parent(s):
48949cc
Update kanjis2radicals.py
Browse files- kanjis2radicals.py +5 -1
kanjis2radicals.py
CHANGED
@@ -63,9 +63,13 @@ class Kanji2Radicals(datasets.GeneratorBasedBuilder):
|
|
63 |
for idx, (image_path, image) in enumerate(images_iter):
|
64 |
print(f"Processing image {idx}...")
|
65 |
print(image_path)
|
|
|
|
|
|
|
|
|
|
|
66 |
yield image_path, {
|
67 |
"radicals": radicals[idx],
|
68 |
"kanji_image": image.read(),
|
69 |
}
|
70 |
|
71 |
-
|
|
|
63 |
for idx, (image_path, image) in enumerate(images_iter):
|
64 |
print(f"Processing image {idx}...")
|
65 |
print(image_path)
|
66 |
+
if not os.path.isdir(image_path): # Add this check
|
67 |
+
print("Skipping")
|
68 |
+
print(image_path)
|
69 |
+
continue
|
70 |
+
|
71 |
yield image_path, {
|
72 |
"radicals": radicals[idx],
|
73 |
"kanji_image": image.read(),
|
74 |
}
|
75 |
|
|