imgly/background-removal-js

How do i use custom models?

isntfunny opened this issue · 7 comments

Is it possible to use custom models, for example from here?

And if so, can they be hosted locally instead of being loaded from an url when using the node version?

In this line there is a reference to a large model. Is it somehow possible to use that to get better results?

https://github.com/imgly/background-removal-js/blob/main/packages/node/src/schema.ts#L43

The large model is using float32 compared to float16. The quality is almost the same.

FYI: I added a new mode with 1.3.0 that outputs the original image resolution

Is there any way (could be hacky) that we can use custom models?

I understand that you said there was no way to do it currently, but I likely need a stronger model to accurately remove backgrounds as neither of the current ones are good enough for my use case.

Joining the original question. Whereas the library works great on complex images, it often fails on images with simple objects. Having the ability to switch models would be an amazing feature of this library.

@DanielHauschildt could you elaborate on why the answer is no? Is this because it is hard to integrate or there are no human resources to do it or something else?

Its just a resource thing.

If you have a proposal for models that work better, please let me know.