The Cloud Vision API occasionally returns different responses to the same request

34 Views Asked by At

This post is using machine translation. Sorry if it is difficult to understand.


I am using FACE DETECTION and DOCUMENT TEXT DETECTION.
I am trying to retrieve face and text information from an image.
I am sending the same request using cURL but sometimes I get different responses back.
Am I wrong in thinking that identical requests will get identical responses?
Is there a way to get an identical response every time?

The following is an example of FACE_DETECTION.

  • input.json
{
  "requests": [
    {
      "image": {
        "content": "/9j......",
      },
      "features": [
        {
          "type": "FACE_DETECTION",
          "model": "builtin/stable"
        }
      ],
      "imageContext": {
        "languageHints": ['ja']
      }
    }
  ]
}
  • request
$ curl -s -X POST -H "Authorization: Bearer "xxxxxxxxxxx -H "Content-Type: application/json; charset=utf-8" -d @input.json https://vision.googleapis.com/v1/images:annotate

Most of the time response 1 is returned, but about 1 out of 10 times response 2 is returned.

  • response 1
{
  "responses": [
    ..........
          "rollAngle": 0.20178626,
          "panAngle": -2.3033228,
          "tiltAngle": 0.5400786,
          ..........
        }
      ]
    }
  ]
}
  • response 2
{
  "responses": [
    ..........
          "rollAngle": 0.2607577,
          "panAngle": -2.2164109,
          "tiltAngle": 0.66491675,
          ..........
        }
      ]
    }
  ]
}
0

There are 0 best solutions below