Fix doctop-on-crop calculation

This commit is contained in:
Jeremy Singer-Vine
2016-03-05 19:03:21 -05:00
parent 3a8d0b7d53
commit 73d44c21c2
+2 -2
View File
@@ -93,7 +93,7 @@ def crop_obj(obj, bbox, score=None):
score = obj_inside_bbox_score(obj, bbox)
if score == 0: return None
if score == 4: return obj
x0, top, x1, bottom = bbox
x0, top, x1, bottom = map(float, bbox)
copy = dict(obj)
x_changed = False
@@ -107,7 +107,7 @@ def crop_obj(obj, bbox, score=None):
if copy["top"] < top:
diff = top - copy["top"]
copy["top"] = top
copy["doctop"] = copy["doctop"] - diff
copy["doctop"] = copy["doctop"] + diff
copy["y1"] = copy["y1"] - diff
y_changed = True
if copy["bottom"] > bottom: