Giter VIP home page Giter VIP logo

codercards's Introduction

CoderCards

Deploy to Azure

About the demo

  • The function is triggered when a new .jpg file appears in the container card-input.

  • Based on an input image, one of 4 card templates is chosen based on emotion

  • The filename of the input image is used to draw the name and title on the card.

  • Filename must be in the form Name of person-Title of person.jpg

  • A score based on the predominant emotion (e.g., anger, happiness) is drawn on the top

  • The card is written to the output blob container card-output

Running the demo

Demo Setup

  1. Fork the repo into your own GitHub

  2. Ensure that you've authorized at least one Azure Web App on your subscription to connect to your GitHub account. To learn more, see Continuous Deployment to Azure App Service.

  3. Click the Deploy to Azure button above.

  1. Open the Function App you just deployed. Go to Function App settings -> Configure Continuous Integration. In the command bar, select Disconnect.

  2. Close and reopen the Function App. Verify that you can edit code in CardGenerator -> Develop.

  3. In Azure Storage Explorer, navigate to the storage account with the same name as your Function App.

    • Create the blob container card-input

    • Output from the function will be in card-output, but you don't need to create this container explicitly.

Running the demo

  1. Choose images that are square with a filename in the form Name of person-Title of person.jpg. The filename is parsed to produce text on the card.

  2. Drop images into the card-input container. Once the function runs, you'll see generated cards in card-output.

Notes

Talking points about Azure Functions

  • The code is triggered off a new blob in a container. We automatically get a binding for both the byte array and the blob name

  • The blob name is used to generate the text on the image

  • The input binding is just a byte array, which makes it easy to manipulate with memory streams (no need to create new ones)

  • Other binding types for C# are Stream, CloudBlockBlob, etc, which is very flexible.

  • The output binding is just a stream that you just write to

  • This is a very declarative model, details of binding are in a separate json file that can be edited manually or through the Integrate UX

  • In general, functions will scale based on the amount of events in input. A real system would probably use something like Azure Queue or Service Bus triggers, in order to track messages more closely.

codercards's People

Contributors

davidebbo avatar lindydonna avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.