Update testdata.py
Browse files- testdata.py +2 -2
testdata.py
CHANGED
|
@@ -132,7 +132,7 @@ class TestData(datasets.GeneratorBasedBuilder):
|
|
| 132 |
# img = cv2.imread(i_file)
|
| 133 |
# img_h, img_w = img.shape[:2]
|
| 134 |
img_h, img_w = 100, 200
|
| 135 |
-
sizes.append([img_h, img_w])
|
| 136 |
|
| 137 |
annotation = defaultdict(list)
|
| 138 |
with open(gt_path, "r", encoding="utf-8") as f:
|
|
@@ -142,7 +142,7 @@ class TestData(datasets.GeneratorBasedBuilder):
|
|
| 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 |
|
|
|
|
| 132 |
# img = cv2.imread(i_file)
|
| 133 |
# img_h, img_w = img.shape[:2]
|
| 134 |
img_h, img_w = 100, 200
|
| 135 |
+
# sizes.append([img_h, img_w])
|
| 136 |
|
| 137 |
annotation = defaultdict(list)
|
| 138 |
with open(gt_path, "r", encoding="utf-8") as f:
|
|
|
|
| 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 |
|