diff --git a/mrcnn/visualize.py b/mrcnn/visualize.py index 8b7885bdc497fcc181158f8cfb9daed9f2c72955..1eae8c86b7c9e758b8b6de43784760f64b192384 100644 --- a/mrcnn/visualize.py +++ b/mrcnn/visualize.py @@ -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,