Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Commit

Permalink
avoid zero division in bbox2loc
Browse files Browse the repository at this point in the history
  • Loading branch information
knorth55 committed Oct 20, 2017
1 parent 3802415 commit 3755023
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chainercv/links/model/faster_rcnn/utils/bbox2loc.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ def bbox2loc(src_bbox, dst_bbox):
base_ctr_y = dst_bbox[:, 0] + 0.5 * base_height
base_ctr_x = dst_bbox[:, 1] + 0.5 * base_width

height = height + 1e-14
width = width + 1e-14

dy = (base_ctr_y - ctr_y) / height
dx = (base_ctr_x - ctr_x) / width
dh = xp.log(base_height / height)
Expand Down

0 comments on commit 3755023

Please sign in to comment.