clip.cpp icon indicating copy to clipboard operation
clip.cpp copied to clipboard

Implement bicubic interpolation

Open monatis opened this issue 2 years ago • 4 comments

Currently clip.cpp uses linear interpolation in image preprocessing. The original implementation uses the bicubic interpolation from Pillow. It needs refactoring from Pillow https://github.com/python-pillow/Pillow/blob/main/src/libImaging/Resample.c#L46-L62

monatis avatar Sep 20 '23 13:09 monatis

An implementation of bicubic interpolation is available inside llama.cpp.

https://github.com/ggerganov/llama.cpp/blob/master/examples/llava/clip.cpp#L1431

lithdew avatar Jul 01 '24 09:07 lithdew

Yes, I upstreamed clip.cpp to llama.cpp for LLaVA, and now there's some functionality that needs to be downstreamed from llama.cpp back to this repo. Currently I don't have enough time to maintain it, though. Maybe next month.

monatis avatar Jul 01 '24 09:07 monatis

I'm looking to use clip.cpp in a project soon - would you mind if I make a PR that brings some of the features in llama.cpp into clip.cpp?

lithdew avatar Jul 01 '24 09:07 lithdew

@lithdew That would be awesome. And feel free to ping me if you need to ask anything about the implementation.

monatis avatar Jul 01 '24 09:07 monatis