ridicurious.com
Azure, Powershell

Bing Search Images, detect Emotions, Save with PowerShell & Azure

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

  1. Install the PSCognitiveService module from PowerShell Gallery and Import it in your current session

  2. Create AzureRM Cognitive Service Accounts for subscription keys

  3. 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.
  4. Search the web for a keyword to find Images and capture the Image URLs

  5. Detect emotion in each image using cmdlet: Get-Face and get the Happiness scores

  6. Use this happiness score filter out Images with a score above 90%.
  7. Analyze the Images with cmdlet: Get-ImageAnalysis to get caption text.
  8. Use the caption to locally save the image on your file system with a unique name that describes the Image.
  9. 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!

 

Subscribe to our mailing list

* indicates required

Related posts

Adding leading zero with PowerShell Format Operator

Prateek Singh
7 years ago

PowerShell 7 Profile Paths and Locations

Prateek Singh
4 years ago

Monaco Editor – Full Code Editor experience in Azure Cloud Shell

Prateek Singh
6 years ago
Exit mobile version