VK Cloud logo
Обновлена31 октября 2023 г. в 06:09

Использование Curl

Автономера

Запрос:

1curl -k -v "https://smarty.mail.ru/api/v1/objects/detect?oauth_provider=mcs&oauth_token=xxx"       \
2   -F file_0=@examples/car_number1.jpg                                                             \
3   -F file_1=@examples/x5.png                                                                      \
4   -F meta='{                                                                                      \
5                "mode":["car_number"],                                                             \
6                "images":[                                                                         \
7                   {                                                                               \
8                     "name":"file_1"                                                               \
9                   },                                                                              \
10                   {                                                                               \
11                      "name":"file_0"                                                              \
12                   }]                                                                              \
13             }'

Ответ:

1{
2  "status":200,
3  "body":
4  {
5    "car_number_labels":[
6    {
7      "status":0,
8      "name":"file_0",
9      "labels":[
10         {
11           "eng":"K200PT98",
12           "rus":"К200РТ98",
13           "prob":0.7168,
14           "coord":[24,70,220,117]
15         }]
16    },
17    {
18      "status":0,
19      "name":"file_1",
20      "labels":[
21        {
22          "eng":"M505KC99",
23          "rus":"М505КС99",
24          "prob":0.8434,
25         "coord":[955,427,1045,477]
26        }]
27    }]
28  },
29  "htmlencoded":false,
30  "last_modified":0
31}

Объекты+сцены

curl -k -v "https://smarty.mail.ru/api/v1/objects/detect?oauth_provider=mcs&oauth_token=xxx" -F file_0=@examples/car_number1.jpg  -F file_1=@examples/x5.png  -F meta='{"mode":["object", "scene"],"images":[{"name":"file_1"}, {"name":"file_0"}]}'

Персоны

curl -k -v "https://smarty.mail.ru/api/v1/persons/recognize?oauth_provider=mcs&oauth_token=xxx" -F file_0=@examples/friends1.jpg  -F file_1=@examples/rachel-green.jpg -F meta='{"images":[{"name":"file_1"}, {"name":"file_0"}], "space":"1"}'