Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing rectangle offset calculation when drawing the detected object in F-RCNN example #3463

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
8 changes: 4 additions & 4 deletions Examples/Image/Detection/utils/plot_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ def visualize_detections(img_path, roi_coords, roi_labels, roi_scores,
color = getColorsPalette()[label]

rect = [(rect_scale * i) for i in roi_coords[roiIndex]]
rect[0] = int(max(0, min(pad_width, rect[0])))
rect[1] = int(max(0, min(pad_height, rect[1])))
rect[2] = int(max(0, min(pad_width, rect[2])))
rect[3] = int(max(0, min(pad_height, rect[3])))
rect[0] = int(max(0, min(pad_width, rect[0])) + h_border)
rect[1] = int(max(0, min(pad_height, rect[1])) + v_border)
rect[2] = int(max(0, min(pad_width, rect[2])) + h_border)
rect[3] = int(max(0, min(pad_height, rect[3])) + v_border)

# draw in higher iterations only the detections
if iter == 0 and draw_negative_rois:
Expand Down