Ge Zheng
commited on
Commit
·
8d570cc
1
Parent(s):
3dc5db9
fix coco annotation parser (#324)
Browse files
yolox/data/datasets/coco.py
CHANGED
@@ -66,8 +66,8 @@ class COCODataset(Dataset):
|
|
66 |
for obj in annotations:
|
67 |
x1 = np.max((0, obj["bbox"][0]))
|
68 |
y1 = np.max((0, obj["bbox"][1]))
|
69 |
-
x2 = np.min((width
|
70 |
-
y2 = np.min((height
|
71 |
if obj["area"] > 0 and x2 >= x1 and y2 >= y1:
|
72 |
obj["clean_bbox"] = [x1, y1, x2, y2]
|
73 |
objs.append(obj)
|
|
|
66 |
for obj in annotations:
|
67 |
x1 = np.max((0, obj["bbox"][0]))
|
68 |
y1 = np.max((0, obj["bbox"][1]))
|
69 |
+
x2 = np.min((width, x1 + np.max((0, obj["bbox"][2]))))
|
70 |
+
y2 = np.min((height, y1 + np.max((0, obj["bbox"][3]))))
|
71 |
if obj["area"] > 0 and x2 >= x1 and y2 >= y1:
|
72 |
obj["clean_bbox"] = [x1, y1, x2, y2]
|
73 |
objs.append(obj)
|