Mojifier-csharp : Overlay emojis on faces based on the emotion detected using Microsoft Cognitive Services and Azure Functions
This project was an inspiration from one of the courses at Microsoft Learn for making a Mojifier slackbot but using Typescript.
This project has been completely rewritten in C# and using different libraries and methods.
We are leveraging the power of serverless computing and AI to detect faces and their emotions from a picture and overlaying appropriate emojis on them. We use Face API from Microsoft Cognitive Services to detect faces and their emotions in a picture and then the Azure Function processes the image, adds an overlay and returns the Mojified image. The flow is as shown below:
- Visual Studio 2019 (if you are using Visual Studio 2017, you need to install the Azure Functions Extension) or Visual Studio Code with Azure Functions Extension
- Azure Subscription
- Face API resource in Azure
- Storage Account resource in Azure (included in Azure function app on Azure)
- Open the local.settings.json file in the mojifier solution and replace the <YOUR_API_URL> with your Face API URL and <YOUR_FACE_API_KEY> with your Face API Key
- Add a container in the storage account and add the images under Emoji_images folder in the repository
- Open one of the images in the container and copy the image URL and replace it with <YOUR_STORAGE_ACCOUNT_URL> without the image name and extension
- Run the solution
And finally, many thanks to the authors and contributors of ImageSharp for developing an amazing nuget package for processing the image and overlaying the emoji on the picture. 🎉
Feel free to raise an issue in case you face anything and would love to improve it with collaboration and contribution.
Happy coding and Happy Mojifying! :happy: