-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example of using DALI with binary data #135
Comments
Sending binary data to Triton server through HTTP request is described here. You don't need to adjust anything in model itself to utilize it. |
@banasraf do you happen to have an example of a valid payload with the JSON prefix that would work for that config? I have it working with Triton when I'm not using DALI but I get errors when trying to do it with DALI. |
Hey @banasraf, any chance you'd have a sample payload available? |
Hi @danvass , Unfortunately, we don't have any example of sending image data through the HTTP request. In case you would like to work put together an example, we'll be happy to help you - just tell us what errors do you have, or any details that would give some insides. We can work something out together and contribute this to DALI Backend repository, if you will agree to. |
Hi @danvas,
Can you share the code snippet and the server configuration (bot working and non-working cases) so we can take a look? |
@danvass
I got the response:
Which is valid. The response is binary, so it should be outputted to a file. Important notes:
Curl will need |
Thanks @banasraf. I am trying to achieve this by specifying the inference header JSON to set the output to not be binary, like so:
and appending this image to the end. However, I get the following output:
I expect I'm missing some formatting when it comes to appending the bytes of the image or calculating its binary_data_size? Hence why I was looking for an example of preparing the JSON and the image for this format. |
@danvass For me the whole process looked like this:
Then I prepare the request:
I check the size of the inference_header.json (175 bytes in this case), to use it in the header. The curl command looks like this:
And I get the valid response. |
Thnks @banasraf, are you testing this on the inception_ensemble example? I'm getting this response when I tried adjusting it to your example:
What is the expected input shape of your one? In the example, it's -1 as per https://github.com/triton-inference-server/dali_backend/blob/main/docs/examples/inception_ensemble/model_repository/ensemble_dali_inception/config.pbtxt#L29. |
@danvass The shape in config is in fact -1, but that means the dynamic dimension - so it should accept any size. Could you try specifying [1005970] instead? Maybe the problem is with dimensionality. |
Also, I see that the name of the model in your case is ensemble_dali, and in config it's "ensemble_dali_inception" |
@banasraf I renamed the models and set the batch size to 0. Would that affect it?
I tried changing the input dims to |
Yup. If you set the max_batch_size to 0, you have to specify the batch dimension in shape field. |
Got it, that makes sense thank you @banasraf How do you determine what's a reasonable |
@danvass And about sending a batch of images: This might seem like an unnecessary overhead of sending zeros, but DALI performance really shines mostly when processing batches of data, so it's rather beneficial to send multiple images at once, even with padding. |
@banasraf Thanks for putting this example together! It helped me a ton yesterday. |
Are there any samples of sending images as binary data to the inception_ensemble example without using Triton client and with raw HTTP requests using CURL or similar? Are there modifications that need to be made (like changing the input data type to string and the dimensions)?
The text was updated successfully, but these errors were encountered: