multi-model-server icon indicating copy to clipboard operation
multi-model-server copied to clipboard

How to represent any size in the signature.json file

Open wangce888 opened this issue 5 years ago • 7 comments

My input image is [batch, 3, None, None], how to represent any size in the signature.json file. I think a solution is to remove image.resize(img_arr, w, h) in mxnet_vision_servion_service.py. But how can I represent any size in the signature.json file?

wangce888 avatar Mar 11 '19 09:03 wangce888

Sorry, I mean image.resize(img_arr, w, h) can turn the image into any size.

wangce888 avatar Mar 11 '19 10:03 wangce888

I am not sure I understand your question. The "mxnet_vision_service.py" file is completely in the model owners control. The assumption is that the model owner brings in this file, along with other model artifacts to MMS. You could modify the value of "w", "h" on every request based on the image size or the network that you choose (if you have multiple networks in the model).

vdantu avatar Mar 11 '19 17:03 vdantu

@aikudexiaohai : Would you be able to give more information about this question or let us know if the above explanation of signature.json help?

vdantu avatar Mar 12 '19 20:03 vdantu

@aikudexiaohai : Following up on this question. If you solved your issue, would you be able to share how you solved it?

vdantu avatar Apr 11 '19 15:04 vdantu

@vdantu \mxnet-model-server\examples\model_service_template\mxnet_model_service.py line 96, the model will bind the input_shape, can we just comment this line to accept arbitrary size of image?

JustinhoCHN avatar Oct 17 '19 01:10 JustinhoCHN

@JustinhoCHN : Firstly I am assuming that you are talking about the "batch" dimension of the input shape. I don't think MXNet supports arbitrary size for input shape. You might have to rebind every time you get different shape, or pad the incoming requests with 0's if you want to bind it once and reuse that bound MXNet module.

vdantu avatar Oct 17 '19 02:10 vdantu

@vdantu sorry, I mean arbitrary w and h, not the batch dimension, since rebind will cost a lot, maybe fix the w and h size would be better. Thanks V~

JustinhoCHN avatar Oct 17 '19 02:10 JustinhoCHN