I have trained my own model, which detects custom object. But I need some tweak.
How to removes the labels and percentages? Example image Given below. I want only the bounding boxes shown.
Line 190: Inside /util/visualization.py
:
for display_str in display_str_list[::-1]:
text_width, text_height = font.getsize(display_str)
margin = np.ceil(0.05 * text_height)
print("\n"+display_str+"\n")
#draw.rectangle(
#[(left, text_bottom - text_height - 2 * margin), (left + text_width,
# text_bottom)],
#fill=color)
#draw.text(
# (left + margin, text_bottom - text_height - margin),
# display_str,
# fill='black',
# font=font)
text_bottom -= text_height - 2 * margin
You can comment the lines that draws the text and the rectangle around it.
vis_util.visualize_boxes_and_labels_on_image_array(
image_np,
output_dict['detection_boxes'],
output_dict['detection_classes'],
output_dict['detection_scores'],
category_index,
max_boxes_to_draw=10,
min_score_thresh=.6,
instance_masks=output_dict.get('detection_masks'),
use_normalized_coordinates=True,
**skip_scores=True**,#removes scores
**skip_labels=True**,#removes lables
line_thickness=5)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With