Last active
November 27, 2018 03:29
-
-
Save zoecarver/3fe42f5f7cd8220c0ad9ec591d26a533 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
def get_hog_features(image, visualize=False): | |
features = hog( | |
image, | |
orientations=9, | |
pixels_per_cell=(8, 8), | |
cells_per_block=(2, 2), | |
visualize=visualize, | |
feature_vector=True, | |
block_norm='L1' | |
) | |
return features | |
def get_features(images): | |
if type(images) is not list: | |
images = [images] | |
all_features = [] | |
for image in images: | |
features = get_hog_features(image) | |
all_features.append(features) | |
return all_features | |
people_features = get_features(people) | |
not_people_features = get_features(not_people) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment