Created
July 14, 2020 15:51
-
-
Save vsreekanti/a641084795a3a19f6f637799734313bc 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
# Create new dataflow with Cloudflow. | |
flow = cloudflow.Dataflow([(‘url’, str)]) | |
# First, apply img_preproc, then apply three models in parallel. | |
img = flow.map(img_preproc) | |
p1 = img.map(resnet_101) | |
p2 = img.map(vgg_16) | |
p3 = img.map(inception_v3) | |
# Combine the results with union, create a group for each input, and pick the highest confidence prediction. | |
flow.output = p1.union(p2, p3).groupby(rowID).agg(max, ‘conf’) | |
# Deploy the dataflow an execute it on an image. | |
flow.deploy() | |
flow.execute(‘s3://my_bucket/my_image’) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment