taesiri commited on
Commit
76d1760
1 Parent(s): 6535289

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
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
- classifications = [
25
- fo.Classification(label=str(label)) for label in sample["labels"]
26
- ]
27
- return fo.Sample(
28
- filepath=sample["file_path"],
29
- labels=fo.Classifications(classifications=classifications),
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__":