Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. # Import patches from matplotlib to draw rectangle for bounding box
  2. import matplotlib.patches as patches
  3.  
  4. # Visualize augmented image and bbox
  5. fig, ax = plt.subplots(1,2, figsize = (15, 10))
  6.  
  7. # Plot the original image and bounding box
  8. ax[0].axis('off')
  9. ax[0].imshow(image)
  10. rect = patches.Rectangle((bboxes[0],bboxes[1]), bboxes[2], bboxes[3],linewidth=1,edgecolor='r',facecolor='none')
  11. ax[0].add_patch(rect)
  12. ax[0].set_title('original image')
  13.  
  14. # Plot the augmented image and bounding box
  15. ax[1].axis('off')
  16. ax[1].imshow(image_aug)
  17. rect = patches.Rectangle((box_aug[0],box_aug[1]), box_aug[2], box_aug[3],linewidth=1,edgecolor='r',facecolor='none')
  18. ax[1].add_patch(rect)
  19. ax[1].set_title('augmented image')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement