Resize image using bilinear filtering (interpolation)?

I need to resize the image to (299,299) in Swift before feeding it to my model.

However, the interpolation method I need to use is billinear filtering, which is what I used when I trained the model.


I've tested out the coreML model in Python. I'm able to resize the image with bilinear filltering via PIL.

Other interpolation methods yield lower accuracy.

However, I can't figure out how to resize with bilinear filtering in Swift/iOS.


Thank you.