khaclinh commited on
Commit
98702f6
1 Parent(s): a430743

Update testdata.py

Browse files
Files changed (1) hide show
  1. testdata.py +2 -3
testdata.py CHANGED
@@ -90,7 +90,6 @@ class TestData(datasets.GeneratorBasedBuilder):
90
  "image": datasets.Image(),
91
  "faces": datasets.Sequence(datasets.Sequence(datasets.Value("float32"), length=4)),
92
  "plates": datasets.Sequence(datasets.Sequence(datasets.Value("float32"), length=4)),
93
- "clates": datasets.Sequence(datasets.Sequence(datasets.Value("float32"), length=4)),
94
  # "size": datasets.Sequence(datasets.Sequence(datasets.Value("float32"), length=2)),
95
 
96
  }
@@ -143,7 +142,7 @@ class TestData(datasets.GeneratorBasedBuilder):
143
  cls, cx, cy, w, h = line.split()[:5]
144
  cls, cx, cy, w, h = int(cls), float(cx), float(cy), float(w), float(h)
145
  x1, y1, x2, y2 = cx - w / 2, cy - h / 2, cx + w / 2, cy + h / 2
146
- # x1, y1, x2, y2 = round(x1 * img_w), round(y1 * img_h), round(x2 * img_w), round(y2 * img_h)
147
  annotation[cls].append([x1, y1, x2, y2])
148
  line = f.readline().strip()
149
 
@@ -154,7 +153,7 @@ class TestData(datasets.GeneratorBasedBuilder):
154
  else:
155
  plates.append([x1, y1, x2, y2])
156
 
157
- yield idx, {"image": i_file, "faces": faces, "plates": plates, "clates": plates}
158
 
159
  idx += 1
160
 
 
90
  "image": datasets.Image(),
91
  "faces": datasets.Sequence(datasets.Sequence(datasets.Value("float32"), length=4)),
92
  "plates": datasets.Sequence(datasets.Sequence(datasets.Value("float32"), length=4)),
 
93
  # "size": datasets.Sequence(datasets.Sequence(datasets.Value("float32"), length=2)),
94
 
95
  }
 
142
  cls, cx, cy, w, h = line.split()[:5]
143
  cls, cx, cy, w, h = int(cls), float(cx), float(cy), float(w), float(h)
144
  x1, y1, x2, y2 = cx - w / 2, cy - h / 2, cx + w / 2, cy + h / 2
145
+ x1, y1, x2, y2 = round(x1 * img_w), round(y1 * img_h), round(x2 * img_w), round(y2 * img_h)
146
  annotation[cls].append([x1, y1, x2, y2])
147
  line = f.readline().strip()
148
 
 
153
  else:
154
  plates.append([x1, y1, x2, y2])
155
 
156
+ yield idx, {"image": i_file, "faces": faces, "plates": plates}
157
 
158
  idx += 1
159