Closed rakeshkeerthi closed 7 years ago
@rakeshkeerthi hrm - that's not a very helpful exception; unfortunately the API docs don't seem to give any more detail as to what the problem is.
Can you try without the similarity threshold and see if that helps?
If that doesn't work can you post the wire logs (see here for enabling them) and we can see what the request actually looks like on the wire and go from there?
Hi @kiiadi , I'm sorry to say that this is not working even after removing the threshold. So I went to your second suggestion.
I'm not sure if the below data is what you have asked for.
I've followed the steps given in the document and the result is
2017-01-05 00:05:34,921 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "POST / HTTP/1.1[\r][\n]" 2017-01-05 00:05:34,923 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: rekognition.us-east-1.amazonaws.com[\r][\n]" 2017-01-05 00:05:34,923 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Authorization: AWS4-HMAC-SHA256 Credential=AKIAJIMX6AV5XIEMXGVA/20170104/us-east-1/rekognition/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-retry;content-length;content-type;host;user-agent;x-amz-date;x-amz-target, Signature=0d35d51e4f44a1df817b52fd52fd984295a045eb8a8ea5234f947ff65c02a74e[\r][\n]" 2017-01-05 00:05:34,923 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "X-Amz-Date: 20170104T183531Z[\r][\n]" 2017-01-05 00:05:34,923 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: aws-sdk-java/1.11.75 Windows_10/10.0 Java_HotSpot(TM)_64-Bit_Server_VM/25.111-b14/1.8.0_111[\r][\n]" 2017-01-05 00:05:34,923 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "amz-sdk-invocation-id: 91ab336b-0416-b6d6-db68-89697dcb05ec[\r][\n]" 2017-01-05 00:05:34,924 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "amz-sdk-retry: 0/0/500[\r][\n]" 2017-01-05 00:05:34,924 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "X-Amz-Target: RekognitionService.CompareFaces[\r][\n]" 2017-01-05 00:05:34,924 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Type: application/x-amz-json-1.1[\r][\n]" 2017-01-05 00:05:34,924 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Length: 153[\r][\n]" 2017-01-05 00:05:34,924 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]" 2017-01-05 00:05:34,924 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]" 2017-01-05 00:05:34,924 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "{"SourceImage":{"S3Object":{"Bucket":"imagesbucketsample","Name":"src.jpg"}},"TargetImage":{"S3Object":{"Bucket":"imagesbucketsample","Name":"tgt.jpg"}}}" 2017-01-05 00:05:36,332 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 400 Bad Request[\r][\n]" 2017-01-05 00:05:36,333 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Type: application/x-amz-json-1.1[\r][\n]" 2017-01-05 00:05:36,333 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Date: Wed, 04 Jan 2017 18:35:35 GMT[\r][\n]" 2017-01-05 00:05:36,333 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "x-amzn-RequestId: 9488583d-d2ac-11e6-b2fb-9d06f52afaed[\r][\n]" 2017-01-05 00:05:36,333 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Length: 81[\r][\n]" 2017-01-05 00:05:36,333 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Connection: keep-alive[\r][\n]" 2017-01-05 00:05:36,333 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]" 2017-01-05 00:05:36,334 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "{"__type":"InvalidParameterException","Message":"Request has Invalid Parameters"}" Exception in thread "main" com.amazonaws.services.rekognition.model.InvalidParameterException: Request has Invalid Parameters (Service: AmazonRekognition; Status Code: 400; Error Code: InvalidParameterException; Request ID: 9488583d-d2ac-11e6-b2fb-9d06f52afaed) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1586) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1254) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1035) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:747) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:721) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:704) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:672) at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:654) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:518) at com.amazonaws.services.rekognition.AmazonRekognitionClient.doInvoke(AmazonRekognitionClient.java:1131) at com.amazonaws.services.rekognition.AmazonRekognitionClient.invoke(AmazonRekognitionClient.java:1107) at com.amazonaws.services.rekognition.AmazonRekognitionClient.compareFaces(AmazonRekognitionClient.java:345) at CompareFacesExample.callCompareFaces(CompareFacesExample.java:49) at CompareFacesExample.main(CompareFacesExample.java:38)
If I'm going wrong, can you please help me in setting up the log?
Are the pictures you are trying actual faces?
Hey,
Thank you @kiiadi and @spfink . The issue was with me, the images are not that accurate.
Thanks Again.
We'll try to work with the service team to get more information on the error messages to assist you in debugging issues in future.
I'm also facing the same issue. Some of the requests are failing saying InvalidParameter Exception. I still couldn't figure out as to why they are failing. I'm using a local folder to supply the images for comparing them against the first image in the folder. Any directions in what causes/reasons result in failing of a request would be very helpful. P.S: All the images are under the limitations listed here.
Hi,
encountered this issue today, although it seems obvious that we're comparing faces from source and target, so if my source image contains boxes instead of faces I would have expected to get an empty result rather than InvalidParameterException
. The error message implies that I've missed something from the required API parameters. thanks
sample log
message: 'Request has Invalid Parameters',
code: 'InvalidParameterException',
time: 2017-10-28T10:57:14.512Z,
requestId: '******',
statusCode: 400,
retryable: false,
retryDelay: 41.314294391341754 }
'InvalidParameterException'^C
opps, I'm on the wrong channel - I'm using Node.js btw but I guess it doesn't matter, no ?
@rixrix, we generally recommend asking your question on stack overflow using the tag amazon-rekognition
which is monitored by the Rekognition service team or opening a support case through your AWS account.
if you are CompareFacesRequest and any one of the request does not has Person Image it is giving me same exception, only came to know with various combinations.
Sorry but this is just so contraintuitive. Just return an empty FaceMatches list/array, it would be really helpful
I just encountered this issue. I agree with @rixrix, this error message is not clear. Is it best practice to run detectFaces() before trying a compareFaces()?
Hi,
I'm trying out the sample odes provided by Amazon for Compare Faces (API). and the code is as below.
When I run this code, I get the below exception.
Out of curiosity I printed the names of the source and target files, these are same as uploaded in the S3 Bucket. Please let me know where am I going wrong and how can I fix this.
Thanks & Regards, Rakesh