Spaces:
Sleeping
Sleeping
nicer
Browse files
maskrcnn_benchmark/engine/predictor_glip.py
CHANGED
@@ -337,10 +337,10 @@ class GLIPDemo(object):
|
|
337 |
|
338 |
if int(y) - text_offset_original < 20:
|
339 |
y += 50
|
340 |
-
|
341 |
position = (int(x), int(y)-text_offset_original)
|
342 |
-
bottom_left_corner_of_text = (position[0], position[1] +
|
343 |
-
top_right_corner = (position[0] +
|
344 |
|
345 |
image[position[1]:bottom_left_corner_of_text[1], position[0]:top_right_corner[0]] = (255, 255, 255)
|
346 |
cv2.putText(
|
|
|
337 |
|
338 |
if int(y) - text_offset_original < 20:
|
339 |
y += 50
|
340 |
+
text_box_size = cv2.getTextSize(s, cv2.FONT_HERSHEY_SIMPLEX, text_size, text_pixel)[0]
|
341 |
position = (int(x), int(y)-text_offset_original)
|
342 |
+
bottom_left_corner_of_text = (position[0], position[1] + text_box_size[1])
|
343 |
+
top_right_corner = (position[0] + text_box_size[0], position[1])
|
344 |
|
345 |
image[position[1]:bottom_left_corner_of_text[1], position[0]:top_right_corner[0]] = (255, 255, 255)
|
346 |
cv2.putText(
|