I wanted to experiment with Azure Cognitive Services, Vision API. SO I thought it would be fun to make a social account that could talk to anyone interested. So @Vision_API on Twitter was born. If tagged on a tweet (or reply) with a photo, the service will reply with a description of the photo.
Simply use Twitter and tag the account @vision_api. ( #vision_api hashtag also works). Wait 30 seconds, and the bot should have replied to you with a description of the photo. If Media (a photo) isn't found on the actual tweet tagged, then the service will look up the thread (all the replies of the replies) and will return a description of the first photo found. This is fun to then reply to any photo on Twitter to see the machines description.
The rest of this README addresses developers interested in also playing with the Azure Cog Services.
If you would like to experiment with the Azure Vision API, you'll need a few items to get started, all of which can be attained for the low cost of $0.00
- Azure Account: Free Trials Available
Once the code is cloned, you'll find a local.settings.json file in the root. This file has all the variables you'll need to populate to get started. You probably won't need to post results back to Twitter, if you're just trying to use the Vision API. So the three keys you'll want to complete are ...
- AzureWebJobsStorage
- AzureVisionApiSubscriptionKey
- AzureVisionUriBase
These values will be retrieved in your code with the static method
GetEnvironmentVariable("<< key name >>")
This example is posting a photo that is already uploaded from Twitter. So the method isn't uploading a byte[] (that overload is available, just not used in this demo). Post that to the helper method FetchVisionDescriptionAsync and you'll get back a VisionDescription.
FetchVisionDescriptionAsync(TwitterStatus tweet, TwitterMedia media)
The method posts a small JSON body of the url of the photo.
{"url":"<< fully qualified url here >>"}
To the
- Azure Vision API
- Azure Functions
- Azure Function :: Timer
- Azure Function :: Queue Trigger
- Azure Table Storage
- TweetMoa Sharp (Forked from Tweet Sharp)
- Scott Cate - Initial work - Twitter/@ScottCate
See also the list of contributors who have (maybe someday) participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details
- Special thanks to the contributors of Tweet Moa Sharp - this would have been much harder without their work
- Twitter friends who endured my countless #vision_api test tweets :)
- You (for trying this and submitting feedback) :)