Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_region_around_face(self, image_width, x, y, w, h):
- x_expand = int(w * HelmetClassification.EXPAND_X)
- y_expand = int(h * HelmetClassification.EXPAND_Y)
- x_new = max(0, x - x_expand)
- w_new = min(image_width - x, w + x_expand)
- y_new = max(0, y - y_expand)
- return x_new, y_new, w_new, h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement