Skip to content
Snippets Groups Projects
Commit 6182c2f6 authored by ssibirtsev's avatar ssibirtsev
Browse files

Update visualize.py

parent b09486ec
No related branches found
No related tags found
No related merge requests found
......@@ -98,7 +98,7 @@ def display_instances(image, boxes, masks, class_ids, class_names,
figsize=(16, 16), ax=None,
show_mask=True, show_bbox=True,
colors=None, captions=None,
save_img=False, save_dir=None, img_name=None, number_saved_images=None, counter_1=None): # Dennis: save-function implemented
save_img=False, save_dir=None, img_name=None, number_saved_images=None, counter_1=None):
"""
boxes: [num_instance, (y1, x1, y2, x2, class_id)] in image coordinates.
masks: [height, width, num_instances]
......@@ -187,25 +187,11 @@ def display_instances(image, boxes, masks, class_ids, class_names,
ax.add_patch(p)
ax.imshow(masked_image.astype(np.uint8))
if save_img:
#choose = round(number_saved_images * random.random()) # Dennis: image with detection save
#choose = round(number_saved_images * random.random()) # save processed image
if (counter_1 == number_saved_images):
plt.savefig(os.path.join(save_dir, img_name + '.jpg'),bbox_inches='tight', pad_inches=False, orientation= 'landscape') # Dennis: image with detection save
plt.savefig(os.path.join(save_dir, img_name + '.jpg'),bbox_inches='tight', pad_inches=False, orientation= 'landscape')
plt.close()
# else: # Dennis: image with detection save
# continue # Dennis: image with detection save
# if auto_show:
# plt.show()
# plt.annotate('25, 50', xy=(25, 40), xycoords='data',
# xytext=(0.5, 0.5), textcoords='figure fraction',
# arrowprops=dict(arrowstyle="->"))
#if save_img: # Dennis: save function
# cv2.imwrite(os.path.join(save_dir, img_name), image) # Dennis: save function
def display_differences(image,
gt_box, gt_class_id, gt_mask,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment