Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -17,17 +17,18 @@ def process_image(i):
|
|
17 |
return {
|
18 |
"file_path": image_path,
|
19 |
"labels": imagenet_hard_dataset[i]["english_label"],
|
|
|
20 |
}
|
21 |
|
22 |
|
23 |
def create_fiftyone_sample(sample):
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
|
32 |
|
33 |
if __name__ == "__main__":
|
|
|
17 |
return {
|
18 |
"file_path": image_path,
|
19 |
"labels": imagenet_hard_dataset[i]["english_label"],
|
20 |
+
"english_label": imagenet_hard_dataset[i]["english_label"],
|
21 |
}
|
22 |
|
23 |
|
24 |
def create_fiftyone_sample(sample):
|
25 |
+
origin_label = fo.Classification(label=str(sample["origin"]))
|
26 |
+
english_label = fo.Classification(label=str(sample["english_label"]))
|
27 |
+
return fo.Sample(
|
28 |
+
filepath=sample["file_path"],
|
29 |
+
labels=fo.Classifications(classifications=[origin_label, english_label]),
|
30 |
+
)
|
31 |
+
|
32 |
|
33 |
|
34 |
if __name__ == "__main__":
|