0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Azure AI Vision の Vectorize Image API をPowerShell で実行する

0
Posted at

この記事の目的

公式ドキュメントにはリファレンスが記載されているが、実行するとき毎回変換する必要があるため、備忘の為、記載する

実行するAPI

実行方法

PowerShell の Invoke-RestMethod を使用して実行する

実行例

$key = "<api key>"
$Resource = "<Resource 名>"
$apiversion = "<REST APIのバージョン>" #2024-02-01
$modelversion = "<modelのバージョン>" #2023-04-15
$url = "https://$Resource.cognitiveservices.azure.com/computervision/retrieval:vectorizeImage?api-version=$apiversion&model-version=$modelversion"
$headers = @{}
$headers["Content-Type"]  = "application/json"
$headers["Ocp-Apim-Subscription-Key"] = "$key"
$body = '{
  "url": "https://learn.microsoft.com/azure/ai-services/computer-vision/media/quickstarts/presentation.png"
}'

$response = Invoke-RestMethod -Uri $url -Method POST -Headers $headers -Body $body
$response

key などの取得方法はこちらを参照

APIのバージョンはREST APIのリファレンスを参照

Modelのバージョンは以下のドキュメント

The 2024-02-01 API includes a multi-lingual model (model version 2023-04-15) that supports text search in 102 languages. 
The original English-only model (version 2022-04-11) is still available, but it cannot be combined with the new model in the same search index. 
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?