powershell 使用百度AI进行文本识别

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/shrekz/article/details/78844633
[void][system.reflection.Assembly]::LoadFrom("C:\Users\win7\Desktop\aipsdk\AipSdk.dll")
[void][system.reflection.Assembly]::LoadFrom("C:\Users\win7\Desktop\aipsdk\thirdparty\Newtonsoft.Json.dll")
$AppID="myAppID"
$APIKey="myAPIKey"
$SecretKey="mySecretKey"

$client=new-object Baidu.Aip.Ocr.Ocr($APIKey,$SecretKey)
$image=[System.IO.File]::ReadAllBytes("C:\Users\win7\Pictures\test.png")
$result=$client.GeneralBasic($image, $null)
$result.ToString()|ConvertFrom-Json|%{$_.words_result.words}

猜你喜欢

转载自blog.csdn.net/shrekz/article/details/78844633