Created
August 22, 2019 01:17
-
-
Save breeko/b9cf7ec7f2334dbea3cc21fbf6f55104 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
fig, axes = plt.subplots(nrows=4,ncols=1, figsize=(12, 24)) | |
axes[0].axis('off') | |
axes[0].imshow(cumberbatch, cmap=plt.cm.gray) | |
axes[0].set_title('Input image') | |
pixels_per_cell = np.array([16,16]) | |
for ax in axes.ravel()[1:]: | |
fd, hog_image = hog(cumberbatch, orientations=8, pixels_per_cell=pixels_per_cell, | |
cells_per_block=(1, 1), visualize=True) | |
hog_image_rescaled = exposure.rescale_intensity(hog_image, in_range=(0, 15)) | |
ax.axis('off') | |
ax.imshow(hog_image_rescaled, cmap=plt.cm.gray) | |
ax.set_title('HOG\n{}'.format(pixels_per_cell)) | |
pixels_per_cell *= 2 | |
plt.tight_layout() | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment