I was able to import my model using .pb + labelmap.pbtxt file and also create endpoint to it = so far so good. Now, I do want to test it and this is where the confusion has arrived.
If I head to DEPLOY AND TEST section it requires to send JSON format to receive response. This is a lot different to what I had in my mobile app as I simple passed the bitmap to the model and it retrieved results. Well, that's fine, I guess I could encode base64 format image and pass it to the model, but this is where I cannot figure out how to do that properly.
Json example is:
{"instances": [{ "instance_key_1": "value", ... }, ...],"parameters": { "parameter_key_1": "value", ... }, ...}
What's the parameter_key_1?
I have not configured such thing.
I tried:
{ "instances": [ { "b64": "long_64_value_of_image" } ] }
and
{ "instances": [ { "image": "long_64_value_of_image" } ] }
And I receive: "error": "Failed to process element: 0 of 'instances' list. Error: INVALID_ARGUMENT: JSON Value: ...
Is there some easy way of adding additional configuration (seems that I'm missing something here) and pass simply preprocessed image (done on client side already) to this endpoint with ease (for instance passing base64 string and getting result?).
Based on what my .tflite model file says (I'd assume that .pb file is the same as that's what I used to upload model to Vertex AI):
Input Tensor: [<tf.Tensor 'input:0' shape=(1, 320, 320, 3) dtype=float32>, <tf.Tensor 'unknown:0' shape=() dtype=resource>...and Output Tensor: [<tf.Tensor 'Identity:0' shape=() dtype=float32>, <tf.Tensor 'Identity_1:0' shape=() dtype=float32>, <tf.Tensor 'Identity_2:0'
How can I construct json, pass it as an Image<float32>? Any help would be highly appreciated.
Just wanted to ask if you are following any steps or documentation for this ?
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |