Bing Search Images using PowerShell Module for Azure Cognitive Services
In this demo, PowerShell Module for Azure Cognitive Service is utilized to programmatically Bing Search Images with a Keyword, then results are analyzed and filtered by emotion (happiness) scores and saved as local files.
Project Page – https://github.com/PrateekKumarSingh/PSCognitiveService
Steps involved
- Install the PSCognitiveService module from PowerShell Gallery and Import it in your current session
-
Create AzureRM Cognitive Service Accounts for subscription keys
- Configure the Subscription keys as $env variables locally in your session and add it to your $profile for later usage. Which will complete the setup and configuration.
- Search the web for a keyword to find Images and capture the Image URLs
- Detect emotion in each image using cmdlet: Get-Face and get the Happiness scores
- Use this happiness score filter out Images with a score above 90%.
- Analyze the Images with cmdlet: Get-ImageAnalysis to get caption text.
- Use the caption to locally save the image on your file system with a unique name that describes the Image.
- and you’re done! 🙂
Code
If you like this video, please subscribe to my youtube channel here which is the motivation for me to create more such videos 🙂 thank you!
Prateek Singh
Engineer. Blogger. Science and Technology fan.
Ridiculously Curious and a compulsive Book reader.
Related posts
3 Comments
Leave a ReplyCancel reply
Categories
Author of Books
Awards
Open Sourced Projects
Author at
Blog Roll
Mike F RobbinsDamien Van Robaeys
Stéphane van Gulick
Kevin Marquette
Adam Bertram
Stephanos Constantinou
Francois-Xavier Cat
Ravikanth Chaganti
Roman Levchenko
Blog Stats
- 1,132,448 People Reached
Hello Prateek,
First, thank you for all your interrestings post.
I have some issue when trying to reproduce your demo.
When running New-CognitiveServiceAccount, an error is trown :
The term ‘New-AzureRmCognitiveServicesAccount’ is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At C:\Users\Eric\Documents\WindowsPowerShell\Modules\PSCognitiveService\0.3.5\Public\New-CognitiveServiceAccount.ps1:84
I can’t find any command with this name in any module.
I have try to rename line 80 New-AzureRmCognitiveServicesAccount to New-CognitiveServiceAccountand reimport module, but then it fails onto $splat parameters Name.
Powershell Version : 5.1.14409.1012
Azure 5.3.0
Azure.Storage 4.3.0
AzureRM.profile 5.1.0
Did I miss something ?
Thank you
Install-Module AzureRM.CognitiveServices
‘This should install the dependent module on your machine, let me know if come across any other issue.
Install-Module AzureRM.CognitiveServices
This should install the dependent module on your machine, let me know if come across any other issue.