Skip to content
Snippets Groups Projects
Commit 210cf68e authored by Mathieu Beligon's avatar Mathieu Beligon
Browse files

[common] (objects) fix: x and y must be at least 0

parent 7a3f6e62
No related branches found
No related tags found
No related merge requests found
......@@ -54,8 +54,10 @@ class ObjectFactory:
int(float(json["bndbox"]["ymax"])) - int(float(json["bndbox"]["ymin"])),
)
x, y = max(0, x), max(0, y)
if t is not ObjectType.Armor:
return Object(type=t, x=x, y=y, w=w, h=h)
return Object(type=t, x=0, y=0, w=w, h=h)
armor_number = int(json["armor_class"]) if json["armor_class"] != "none" else 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment