alexrods commited on
Commit
058ebea
1 Parent(s): 470ea74

Update mini_car_bikes_detection.py

Browse files
Files changed (1) hide show
  1. mini_car_bikes_detection.py +6 -4
mini_car_bikes_detection.py CHANGED
@@ -74,10 +74,12 @@ class MiniCarBikesDetection(datasets.GeneratorBasedBuilder):
74
  annotations = json.load(jf)
75
  for image_file in image_files:
76
  image_name = image_file[0].split("/")[1]
77
- yield image_file, {
78
- "image": {"path": image_file[0], "bytes": image_file[1].read()},
79
- "image_name": image_name,
80
- }
 
 
81
 
82
 
83
 
 
74
  annotations = json.load(jf)
75
  for image_file in image_files:
76
  image_name = image_file[0].split("/")[1]
77
+ for annotation in annotations:
78
+ if image_name == annotation["image"]:
79
+ yield image_file, {
80
+ "image": {"path": image_file[0], "bytes": image_file[1].read()},
81
+ "image_name": image_name,
82
+ }
83
 
84
 
85