Created
November 27, 2018 03:35
-
-
Save zoecarver/c6e704344c37b29020abb915d109ab07 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_image = cv2.imread('test.jpg', COLOR_RGB2GRAY) # load test image | |
test_image = cv2.resize(test_image, (200, 400)) # resize | |
# get all sliding windows we want | |
search_windows = \ | |
sliding_window(test_image, y_stop=200, window=(64, 64), overlap=(.7, .7)) + \ | |
sliding_window(test_image, y_stop=250, window=(80, 80), overlap=(.6, .6)) + \ | |
sliding_window(test_image, y_stop=300, window=(96, 96), overlap=(.5, .5)) + \ | |
sliding_window(test_image, y_stop=350, window=(128, 128), overlap=(.4, .4)) | |
# play with values for sliding window | |
positive_windows = predict_windows(test_image, windows=search_windows, classifier=classifier) | |
annotated_image = draw_boxes(test_image, positive_windows) # positive boxes | |
boxed_image = draw_boxes(test_image, search_windows) # to visualize the search window coverage of our image |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment