Skip to content

Instantly share code, notes, and snippets.

@vsreekanti
Created July 14, 2020 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vsreekanti/a641084795a3a19f6f637799734313bc to your computer and use it in GitHub Desktop.
Save vsreekanti/a641084795a3a19f6f637799734313bc to your computer and use it in GitHub Desktop.
# 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