Datasets:
ArXiv:
License:
Update medianomaly.py
Browse files- medianomaly.py +2 -0
medianomaly.py
CHANGED
|
@@ -250,6 +250,8 @@ class Medianomaly(datasets.GeneratorBasedBuilder):
|
|
| 250 |
for idx, row in df.iterrows():
|
| 251 |
image_id = row["image"]
|
| 252 |
image_path = os.path.join(img_dir, f"{image_id}.jpg")
|
|
|
|
|
|
|
| 253 |
label_vector = row.iloc[1:].astype(int).tolist()
|
| 254 |
|
| 255 |
yield idx, {
|
|
|
|
| 250 |
for idx, row in df.iterrows():
|
| 251 |
image_id = row["image"]
|
| 252 |
image_path = os.path.join(img_dir, f"{image_id}.jpg")
|
| 253 |
+
if not os.path.exists(image_path):
|
| 254 |
+
continue
|
| 255 |
label_vector = row.iloc[1:].astype(int).tolist()
|
| 256 |
|
| 257 |
yield idx, {
|