Compare deux images et renvoie un score de similarité.
Testez maintenant
Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.
Test
Autorisation RAM
|
imagesearch:CompareSimilarByImage |
none |
*All Resource
|
Aucune | Aucune |
Syntaxe de la requête
POST HTTP/1.1
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| PrimaryPicContent |
string |
Oui |
Le contenu de l'image.
Remarque
Lors de l'appel à l'aide d'un SDK : - Seuls les SDK V3 sont pris en charge. Vous n'avez pas besoin de définir le champ PrimaryPicContent. Le SDK encapsule ce champ en tant que PrimaryPicContentObject et le convertit automatiquement en encodage Base64. Pour des exemples, consultez JAVA SDK. - Le SDK ne prend pas en charge le passage direct des URL d'images. Les SDK V3 fournissent un moyen alternatif de télécharger des images par URL. Pour des exemples, consultez JAVA SDK. |
AAAANSUhEUgAAAPcAAAEVCAYAAAA8d3NuAAAAAXNSR0IArs......RK5CYII= |
| SecondaryPicContent |
string |
Oui |
Le contenu de l'image.
Remarque
Lors de l'appel à l'aide d'un SDK : - Seuls les SDK V3 sont pris en charge. Vous n'avez pas besoin de définir le champ PrimaryPicContent. Le SDK encapsule ce champ en tant que PrimaryPicContentObject et le convertit automatiquement en encodage Base64. Pour des exemples, consultez JAVA SDK. - Le SDK ne prend pas en charge le passage direct des URL d'images. Les SDK V3 fournissent un moyen alternatif de télécharger des images par URL. Pour des exemples, consultez JAVA SDK. |
AAAANSUhEUgAAAPcAAAEVCAYAAAA8d3NuAAAAAXNSR0IArs......RK5CYII= |
| InstanceName |
string |
Oui |
Le nom de l'instance Image Search. Le nom peut comporter jusqu'à 20 caractères. Si vous avez acheté une instance Image Search, connectez-vous à la console Image Search pour afficher le nom de l'instance. Si vous n'avez pas acheté d'instance Image Search, consultez Activer le service et Créer une instance. Remarque
Le nom de l'instance n'est pas l'identifiant de l'instance. Assurez-vous de bien les distinguer. |
demoinstance1 |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
Le résultat du calcul de similarité. |
||
| Score |
number |
Le score de similarité de l'image. Valeurs valides : 0 à 1. |
0.85 |
| Success |
boolean |
Indique si la requête a réussi. |
true |
| RequestId |
string |
L'identifiant de la requête. |
B3137727-7D6E-488C-BA21-0E034C38A879 |
| Msg |
string |
Le message d'erreur. |
success |
| AccessDeniedDetail |
object |
Les détails de la réponse d'authentification. |
|
| AuthAction |
string |
L'action pour la requête d'authentification. |
xxx |
| AuthPrincipalDisplayName |
string |
Les informations du principal d'authentification. |
111 |
| AuthPrincipalOwnerId |
string |
L'identifiant du compte Alibaba Cloud du principal d'authentification. |
222 |
| AuthPrincipalType |
string |
Le type du principal d'authentification. |
SubUser |
| EncodedDiagnosticMessage |
string |
Le message de diagnostic chiffré. |
xxxxxx |
| NoPermissionType |
string |
Valeurs valides :
|
ImplicitDeny |
| PolicyType |
string |
Le type de la stratégie qui a provoqué le refus d'accès. |
AccountLevelIdentityBasedPolicy |
| Code |
integer |
Le code d'erreur. Valeurs valides :
|
0 |
Exemples
JSON format
{
"Score": 0.85,
"Success": true,
"RequestId": "B3137727-7D6E-488C-BA21-0E034C38A879",
"Msg": "success",
"AccessDeniedDetail": {
"AuthAction": "xxx",
"AuthPrincipalDisplayName": "111",
"AuthPrincipalOwnerId": "222",
"AuthPrincipalType": "SubUser",
"EncodedDiagnosticMessage": "xxxxxx",
"NoPermissionType": "ImplicitDeny",
"PolicyType": "AccountLevelIdentityBasedPolicy"
},
"Code": 0
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
Description |
|---|---|---|---|
| 400 | SearchTimeout | The request timed out. | |
| 400 | TimeoutForTransferImage | Image transfer timed out. | |
| 400 | UnsupportedPicFormat | The specified image format is invalid. | |
| 400 | UnsupportedPicPixels | The specified pixels is not supported. | |
| 400 | UnsupportedPictureFormat | The format of the specified picture is not supported. | |
| 400 | Console.InstanceNotFound | The specified ImageSearch instance is not found. | The specified instance ID does not exist. Check the instance ID and try again. |
| 400 | Console.PidError | The number of PID bindings of the current instance exceeds 50. | |
| 400 | EmptyMeta | The body content has an empty meta field. | |
| 400 | IncorrectOrientation | The image contains incorrect rotation flags in the meta data. | |
| 400 | InstanceOverQuota | The number of items exceeds the limit. | |
| 400 | InstanceStatusError | The current instance status does not support this operation. | |
| 400 | InvalidInstance | The specified instance name is invalid. | |
| 400 | InvalidPicContent | The image size exceeds 4 MB. | |
| 400 | InvalidPicUrl | The specified parameter PicUrl is not valid. | |
| 400 | NeedRegisterBeforeInvoke | Register for PID before invoking the service. | |
| 400 | NoCaretSeperator | The body content is missing the ^ separator. | |
| 400 | NoSpecifiedPic | The content of an image is not specified in the HTTP POST body. | |
| 400 | PicNotExist | The specified image does not exist. | |
| 400 | InvalidSecondaryPicContent | The specified parameter SecondaryPicContent is not valid. | Invalid SecondaryPicContent parameter |
| 400 | InvalidPrimaryPicContent | The specified parameter PrimaryPicContent is not valid. | Invalid PrimaryPicContent parameter |
| 400 | PictureError | [download] Img Download Failed. | Picture download failed, please check the picture |
| 400 | UnsupportedOperationType | The specified action is not supported. | |
| 400 | UnsupportedInstanceType | The instance type is not supported. | |
| 500 | ServerInternalError | An internal error occurred. | |
| 500 | UnknownException | An internal server error occurred. | |
| 500 | AccessEngineFailed | An error occurred while accessing the search engine. | |
| 500 | ConnectionDVException | Failed to obtain collection. | internalError |
| 500 | Console.CallServiceError | An internal service error occurred. | |
| 500 | ExtractFeatureTimeout | The request timed out while extracting features. | |
| 500 | InternalOssError | An internal OAS error occurred. | |
| 500 | InternalSwiftError | An internal SWIFT error occurred. | |
| 500 | InternalTableStoreError | An internal Table Store error occurred. | |
| 500 | NetworkException | A network error occurred. | |
| 500 | RequestTimeout | The request timed out. | |
| 403 | Console.NoPermissionError | You are not authorized to perform this operation. | |
| 403 | Console.NotAllowedModifyToken | You are not allowed to modify token today. | |
| 403 | DeniedRequest | Your request was denied due to instance flow control. | |
| 403 | NoPermission | You are not authorized to perform this operation. | |
| 409 | Console.TaskAlreadyExist | A task that is in progress already exists. |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.