Thin-Plate-Spline-Motion-Model icon indicating copy to clipboard operation
Thin-Plate-Spline-Motion-Model copied to clipboard

Is retaining alpha channel poissible?

Open Inferencer opened this issue 2 years ago • 3 comments

Looking to retain the alpha transparancy of my source image, if that means the output is in a string of png formats that's ok, is this possible?

Inferencer avatar Jan 25 '23 10:01 Inferencer

I have tried .gif etc and found some good results. (I would like a list of supported outputs) I have also tried convertin to png using the following in demo.py before the last line

import cv2
from skimage import img_as_ubyte
for i in rangle(len(predictions)):
    cv2.imwrite(f'{i}.png', img_as_ubyte(predictions[i][:,:,::-1]))

However I can an error of:

  File "C:\Users\leolo\Thin-Plate-Spline-Motion-Model\demo.py", line 179, in <module>
    for i in rangle(len(predictions)):
NameError: name 'rangle' is not defined

Inferencer avatar Jan 25 '23 12:01 Inferencer

You should use range, not rangle

instant-high avatar Jan 25 '23 14:01 instant-high

That has fixed it but it dosent retain alpha transaparancy on the png which is a shame, I'll stick with ffmpeg for splitting as it's 20x faster than whatever TPSMM just tried to do & use a background remover AI.

Inferencer avatar Jan 25 '23 15:01 Inferencer