advimman / lama

🦙 LaMa Image Inpainting, Resolution-robust Large Mask Inpainting with Fourier Convolutions, WACV 2022
https://advimman.github.io/lama-project/
Apache License 2.0
8.16k stars 865 forks source link

Add torchserve support #173

Open EgonFerri opened 2 years ago

EgonFerri commented 2 years ago

As far as i understand, it is not possible to easly port this model to torchserve. Is not possible to export it in torchscript because some parts of the code, and is not possible to export it with a simple class file for the heavily nested structure. This complicates a lot deployng the model in a production envirnoment. Im not a torchserve expert, am I missing something? Do you have suggestions or possible solutions?

EgonFerri commented 2 years ago

In the end, we decided to develop it in-house.

We got it to work via TorchServe in eager mode, both on CPU and GPU.

In our opinion, our work could be really helpful, allowing the stable use of LaMa in a production scenario.

After a bit of cleanup, we are considering releasing our code, so let me know if you could be interested in linking it from the main page.

DanielZanchi commented 1 year ago

Hello! This would be interesting, are you using with GPU? Is it much faster than CPU?

windj007 commented 1 year ago

Hi! Such a great contribution definitely would be a welcome! Please share if you find it OK for your company and situation.

huytuong010101 commented 1 year ago

@EgonFerri Nice work, can you share it?

rowhanm commented 1 year ago

Hey @EgonFerri, would be great if you could share how you got it to work with TorchServe!