Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. def get_region_around_face(self, image_width, x, y, w, h):
  2. x_expand = int(w * HelmetClassification.EXPAND_X)
  3. y_expand = int(h * HelmetClassification.EXPAND_Y)
  4.  
  5. x_new = max(0, x - x_expand)
  6. w_new = min(image_width - x, w + x_expand)
  7.  
  8. y_new = max(0, y - y_expand)
  9.  
  10. return x_new, y_new, w_new, h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement