< Back
Get-AgeAndGender
Post
NAME Get-AgeAndGender
SYNOPSIS
Returns information about Age and Gender of identified faces in a local Image.
SYNTAX
Get-AgeAndGender [-Path] <String> [-Draw] [<CommonParameters>]
DESCRIPTION
Function returns Age and Gender of indentified faces in an Image, in addition if used with "-draw" switch it will
draw the identified face rectangles on the local Image, depicting age and gender.And show you results in a GUI.
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
-Path <String>
Required? true
Position? 2
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-Draw [<SwitchParameter>]
Required? false
Position? named
Default value False
Accept pipeline input? false
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
-------------------------- EXAMPLE 1 --------------------------
PS Root\\>Get-AgeAndGender -Path .\\group.jpg
Age Gender FaceRectangle Image
--- ------ ------------- -----
41 Female @{left=40; top=70; width=49; height=49} group.jpg
24 Female @{left=231; top=123; width=47; height=47} group.jpg
35 Female @{left=161; top=98; width=47; height=47} group.jpg
30 Female @{left=307; top=88; width=45; height=45} group.jpg
38 Male @{left=127; top=43; width=42; height=42} group.jpg
37 Male @{left=238; top=42; width=37; height=37} group.jpg
Passing an local image path to the cmdlet will return you the Age and gender of identified faces in the Image.
-------------------------- EXAMPLE 2 --------------------------
PS Root\\>Get-AgeAndGender -Path .\\pic.jpg -Draw
If you use '-Draw' switch with the cmdlet it will draw the face rectangle on the local Image, depicting age and
gender.And show you results in a GUI.
-------------------------- EXAMPLE 3 --------------------------
PS Root\\>"C:\\Users\\prateesi\\Documents\\Data\\Powershell\\Scripts\\group.jpg","C:\\Users\\prateesi\\Documents\\Data\\Powershe
ll\\Scripts\\profile.jpg" | Get-AgeAndGender
Age Gender FaceRectangle Image
--- ------ ------------- -----
41 Female @{left=40; top=70; width=49; height=49} group.jpg
24 Female @{left=231; top=123; width=47; height=47} group.jpg
35 Female @{left=161; top=98; width=47; height=47} group.jpg
30 Female @{left=307; top=88; width=45; height=45} group.jpg
38 Male @{left=127; top=43; width=42; height=42} group.jpg
37 Male @{left=238; top=42; width=37; height=37} group.jpg
31 Male @{left=418; top=142; width=222; height=222} profile.jpg
You can also pass multiple local images through pipeline to get the Age and gender information.
RELATED LINKS
SYNOPSIS
Returns information about Age and Gender of identified faces in a local Image.
SYNTAX
Get-AgeAndGender [-Path] <String> [-Draw] [<CommonParameters>]
DESCRIPTION
Function returns Age and Gender of indentified faces in an Image, in addition if used with "-draw" switch it will
draw the identified face rectangles on the local Image, depicting age and gender.And show you results in a GUI.
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
-Path <String>
Required? true
Position? 2
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-Draw [<SwitchParameter>]
Required? false
Position? named
Default value False
Accept pipeline input? false
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
-------------------------- EXAMPLE 1 --------------------------
PS Root\\>Get-AgeAndGender -Path .\\group.jpg
Age Gender FaceRectangle Image
--- ------ ------------- -----
41 Female @{left=40; top=70; width=49; height=49} group.jpg
24 Female @{left=231; top=123; width=47; height=47} group.jpg
35 Female @{left=161; top=98; width=47; height=47} group.jpg
30 Female @{left=307; top=88; width=45; height=45} group.jpg
38 Male @{left=127; top=43; width=42; height=42} group.jpg
37 Male @{left=238; top=42; width=37; height=37} group.jpg
Passing an local image path to the cmdlet will return you the Age and gender of identified faces in the Image.
-------------------------- EXAMPLE 2 --------------------------
PS Root\\>Get-AgeAndGender -Path .\\pic.jpg -Draw
If you use '-Draw' switch with the cmdlet it will draw the face rectangle on the local Image, depicting age and
gender.And show you results in a GUI.
-------------------------- EXAMPLE 3 --------------------------
PS Root\\>"C:\\Users\\prateesi\\Documents\\Data\\Powershell\\Scripts\\group.jpg","C:\\Users\\prateesi\\Documents\\Data\\Powershe
ll\\Scripts\\profile.jpg" | Get-AgeAndGender
Age Gender FaceRectangle Image
--- ------ ------------- -----
41 Female @{left=40; top=70; width=49; height=49} group.jpg
24 Female @{left=231; top=123; width=47; height=47} group.jpg
35 Female @{left=161; top=98; width=47; height=47} group.jpg
30 Female @{left=307; top=88; width=45; height=45} group.jpg
38 Male @{left=127; top=43; width=42; height=42} group.jpg
37 Male @{left=238; top=42; width=37; height=37} group.jpg
31 Male @{left=418; top=142; width=222; height=222} profile.jpg
You can also pass multiple local images through pipeline to get the Age and gender information.
RELATED LINKS