Description
Bug Report
- import path
.../services/cognitiveservices/v1.0/face"
- SDK version:
34.0.0
- Go Version:
go1.13.1 darwin/amd64
What happened?
When I try to call AddPhoto method of Cognitive through a picture that includes more than 1 face remote service returns me an error with description like "there is more 1 face", after that I call the Detect method to get coordinates of required face and then send it again, but AddFace answers me that coordinates are incorrect.
Instead of sending correct coordinates it sends value like this <int32 Value> <int32 Value> <int32 Value> <int32 Value>
What did you expect or want to happen?
I send coordinates and picture then receive a correct answer with persisted_face_id
How can we reproduce it?
Use face.LargeFaceListClient
and call AddFaceFromURL
set the valid targetFace with []int32{}
and send a request to a mock server to have an opportunity to see the result of that request.
Btw, I've found the reason.
Here we are calling autorest.Encode("query", targetFace, ",")
and this is the reason of that behavior.
azure-sdk-for-go/services/cognitiveservices/v1.0/face/largefacelist.go
Lines 288 to 290 in 781d9fb
As we know, targetFace
is a slice of int32
, but autorest.Encode
under the hood wants to get a slice of strings or some types derived from string.
Look:
So, now I don't really understand where we have to fix it. Either in go-autorest
or here?