XintongHe commited on
Commit
5a77adc
1 Parent(s): a1a29f4

Update Stomatal_Images_Datasets.py

Browse files
Files changed (1) hide show
  1. Stomatal_Images_Datasets.py +8 -4
Stomatal_Images_Datasets.py CHANGED
@@ -98,10 +98,14 @@ class NewDataset(datasets.GeneratorBasedBuilder):
98
 
99
  for line in yolo_data:
100
  class_id, x_center_rel, y_center_rel, width_rel, height_rel = map(float, line.split())
101
- x_min = (x_center_rel - width_rel / 2) * width
102
- y_min = (y_center_rel - height_rel / 2) * height
103
- x_max = (x_center_rel + width_rel / 2) * width
104
- y_max = (y_center_rel + height_rel / 2) * height
 
 
 
 
105
  annotations.append({
106
  "category_id": int(class_id),
107
  "bounding_box": {
 
98
 
99
  for line in yolo_data:
100
  class_id, x_center_rel, y_center_rel, width_rel, height_rel = map(float, line.split())
101
+ # x_min = (x_center_rel - width_rel / 2) * width
102
+ # y_min = (y_center_rel - height_rel / 2) * height
103
+ # x_max = (x_center_rel + width_rel / 2) * width
104
+ # y_max = (y_center_rel + height_rel / 2) * height
105
+ x_min = x_center_rel
106
+ y_min = y_center_rel
107
+ x_max = width_rel
108
+ y_max = height_rel
109
  annotations.append({
110
  "category_id": int(class_id),
111
  "bounding_box": {