Last active
December 14, 2017 08:02
-
-
Save tendstofortytwo/0d3888bad9ff119f6886f2d338cc4904 to your computer and use it in GitHub Desktop.
Origami-lib getImageArray file path example
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
import cv2 | |
import origami | |
# all memory/processor intensive work that is to be done only once (like loading models) goes here | |
# replace $TOKEN with your app token generated by web app | |
app = origami.register('$TOKEN') | |
@origami.crossdomain | |
@app.listen() | |
def images(): | |
# accept paths of two images | |
all_image_paths = origami.getImageArray() | |
# paths can be accessed as elements of array | |
image_1_path = all_image_paths[0] | |
image_2_path = all_image_paths[1] | |
# load images from path as numpy arrays | |
image_1 = cv2.imread(image_1_path) | |
image_2 = cv2.imread(image_2_path) | |
# need to return something | |
origami.sendImageArray(all_image_paths, mode='file_path') | |
return 'OK' | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment