Skip to content

Commit

Permalink
fix issue Cartucho#38
Browse files Browse the repository at this point in the history
  • Loading branch information
Cartucho committed Dec 12, 2018
1 parent 840d5b6 commit 223670a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def draw_plot_func(dictionary, n_classes, window_title, plot_title, x_label, out
light_red = (30,30,255)
# 1st line
margin = 10
v_pos = int(height - margin - (bottom_border / 2))
v_pos = int(height - margin - (bottom_border / 2.0))
text = "Image: " + ground_truth_img[0] + " "
img, line_width = draw_text_in_image(img, text, (margin, v_pos), white, 0)
text = "Class [" + str(class_index) + "/" + str(n_classes) + "]: " + class_name + " "
Expand All @@ -540,7 +540,7 @@ def draw_plot_func(dictionary, n_classes, window_title, plot_title, x_label, out
color = green
img, _ = draw_text_in_image(img, text, (margin + line_width, v_pos), color, line_width)
# 2nd line
v_pos += int(bottom_border / 2)
v_pos += int(bottom_border / 2.0)
rank_pos = str(idx+1) # rank position (idx starts at 0)
text = "Prediction #rank: " + rank_pos + " confidence: {0:.2f}% ".format(float(prediction["confidence"])*100)
img, line_width = draw_text_in_image(img, text, (margin, v_pos), white, 0)
Expand All @@ -552,7 +552,7 @@ def draw_plot_func(dictionary, n_classes, window_title, plot_title, x_label, out

font = cv2.FONT_HERSHEY_SIMPLEX
if ovmax > 0: # if there is intersections between the bounding-boxes
bbgt = [ int(x) for x in gt_match["bbox"].split() ]
bbgt = [ int(round(float(x))) for x in gt_match["bbox"].split() ]
cv2.rectangle(img,(bbgt[0],bbgt[1]),(bbgt[2],bbgt[3]),light_blue,2)
cv2.rectangle(img_cumulative,(bbgt[0],bbgt[1]),(bbgt[2],bbgt[3]),light_blue,2)
cv2.putText(img_cumulative, class_name, (bbgt[0],bbgt[1] - 5), font, 0.6, light_blue, 1, cv2.LINE_AA)
Expand Down

0 comments on commit 223670a

Please sign in to comment.