Created
December 1, 2019 09:32
-
-
Save Noob-can-Compile/7fc854c63a16252af49fb463aabf0437 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test out some of these transforms | |
rescale = Rescale(100) | |
crop = RandomCrop(50) | |
composed = transforms.Compose([Rescale(250), | |
RandomCrop(224)]) | |
# apply the transforms to a sample image | |
test_num = 500 | |
sample = face_dataset[test_num] | |
fig = plt.figure() | |
for i, tx in enumerate([rescale, crop, composed]): | |
transformed_sample = tx(sample) | |
ax = plt.subplot(1, 3, i + 1) | |
plt.tight_layout() | |
ax.set_title(type(tx).__name__) | |
show_keypoints(transformed_sample['image'], transformed_sample['keypoints']) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment