Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Import patches from matplotlib to draw rectangle for bounding box
- import matplotlib.patches as patches
- # Visualize augmented image and bbox
- fig, ax = plt.subplots(1,2, figsize = (15, 10))
- # Plot the original image and bounding box
- ax[0].axis('off')
- ax[0].imshow(image)
- rect = patches.Rectangle((bboxes[0],bboxes[1]), bboxes[2], bboxes[3],linewidth=1,edgecolor='r',facecolor='none')
- ax[0].add_patch(rect)
- ax[0].set_title('original image')
- # Plot the augmented image and bounding box
- ax[1].axis('off')
- ax[1].imshow(image_aug)
- rect = patches.Rectangle((box_aug[0],box_aug[1]), box_aug[2], box_aug[3],linewidth=1,edgecolor='r',facecolor='none')
- ax[1].add_patch(rect)
- ax[1].set_title('augmented image')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement