This message was deleted.
# ask-for-help
s
This message was deleted.
🍱 2
a
You can do the following for API definition
Copy code
@svc.api(input=bentoml.io.Multipart(img1=bentoml.io.Image(...), img2=bentoml.io.Image(...)))
def predict(inputs): ...
g
Hey @Aaron Pham , thank you for taking time. I guess the snippet takes only two images but i need it for multiple images (Count is dynamic) Thank you
May be a dict of tuples like {image1: (imagename: image object),image2:(imagename,imageobj)…..}
a
my q is why doo you need the image_name for?
🍱 1
g
I’m sending image name from my fastapi gateway
Even a dictionary of images like {imagename: Imageobj, Imagename2:Imageobj} is fine but size of the dictionary (images) has to be dynamic i guess
a
right now we don’t have support for dynamic input, (which we should) cc @sauyon If you want to pass in dictionary you def do so with dictionary unpack rn, but the size of the dictionary wouldn’t be dynamic
g
Any other way to get multiple images at the same time Maybe something like List[images]
s
Yep, it's on our radar but probably not going to be implemented for a little bit as we're focusing on other stuff right now.
a
This is the issue that tracks similar rfc https://github.com/bentoml/BentoML/issues/2972 One extension for input and output is that it should support python type hints, similar to what you suggest
Copy code
(input=list[bentoml.io.Image],output=tuple[bentoml.io.File])
But as Sauyon mentioned, this is a low priority for us right now. But we are happy to discuss the details should you want to implement such feature
g
Nice , I’ll come up with some flexible way of doing it. Thank you