Last active
September 28, 2017 02:14
-
-
Save SeaOfOcean/19bcd9813a836e3c1663931276554a80 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# preprocess data | |
(data, sizes) = preprocess(img_rdd, means, scale, resolution) | |
# image prediction | |
output = model.predict(data) | |
# scale normalized results according to original image sizes | |
result = output.zip(sizes).map(lambda (output_i, img_size): | |
scaleOutput(output_i, img_size) | |
).collect() | |
# visualize detections | |
for img_id in range(len(result)): | |
detections = result[img_id] | |
visualize(images[img_id], detections) | |
plt.subplots(figsize=(6, 6)) | |
plt.imshow(cv2.cvtColor(images[img_id], cv2.COLOR_BGR2RGB)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment