< Back

Get-Celebrity

Sun Jan 19, 2020 5:34 pm

NAME Get-Celebrity



SYNOPSIS

Cmdlet is capable to identify the Names and total numbers of Celebrities in a web hosted Image.





SYNTAX

Get-Celebrity [[-URL] <String>] [<CommonParameters>]





DESCRIPTION

This cmdlet is Using Microsoft cognitive service's "Computer Vision" API as a service to get the information

needed by issuing an HTTP request to the API

NOTE : You need to subscribe the "Computer Vision API" before using the powershell script from the following link

and setup an environment variable like, $env:MS_ComputerVision_API_key = "YOUR API KEY"



API Subscription Page - https://www.microsoft.com/cognitive-ser ... us/sign-up





PARAMETERS

-URL <String>

Image URL where you want to identify the Celebrities.



Required? false

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Author: Prateek Singh - @SinghPrateik



-------------------------- EXAMPLE 1 --------------------------



PS Root\\>Get-Celebrity -URL "http://img2.tvtome.com/i/u/aa0f22141369 ... 6c4271.jpg"



Celebrities Count URL



----------- ----- ---



{David Schwimmer, Matthew Perry, Jennifer Aniston} 3

http://img2.tvtome.com/i/u/aa0f22141369 ... 6c4271.jpg



In above example, Function identifies all celebrities in the web hosted image and their head count. Then returns

the Information like, Celebrity name, Count and URL searched.









-------------------------- EXAMPLE 2 --------------------------



PS Root\\>$URLs = "http://az616578.vo.msecnd.net/files/201 ... oscars.jpg",



"http://upload.wikimedia.org/wikipedia/c ... 14136945d8

c57879a5166c4271.jpg",

"Http://www.newstatesman.com/sites/defau ... ker(1).jpg",

"http://i.huffpost.com/gen/2018240/image ... cebook.jpg"



$URLs | Get-Celebrity |ft * -AutoSize



Celebrities Count URL



----------- ----- ---



{Bradley Cooper, Ellen DeGeneres, Jennifer Lawrence} 3

http://az616578.vo.msecnd.net/files/201 ... oscars.jpg

Satya Nadella 1

http://upload.wikimedia.org/wikipedia/c ... adella.jpg

{David Schwimmer, Matthew Perry, Jennifer Aniston} 3

http://img2.tvtome.com/i/u/aa0f22141369 ... 6c4271.jpg

David Schwimmer 1

http://www.newstatesman.com/sites/defau ... ker(1).jpg

{David Schwimmer, Lisa Kudrow, Matthew Perry, Matt LeBlanc...} 5

http://i.huffpost.com/gen/2018240/image ... cebook.jpg



You can also, pass multiple URL's to the cmdlet as it accepts the Pipeline input and will return the results.











RELATED LINKS