masks-and-hats icon indicating copy to clipboard operation
masks-and-hats copied to clipboard

how can add mask become more realtime?

Open wzc118 opened this issue 6 years ago • 0 comments

Thx for sharing this interesting demo. I find that with the increasing number of faces, the step of adding a transparent mask (png) to the original photo consuming much more time, about 0.2s per mask. I think firstly merge these masks to one transparent backgound picture and then add to the original photo will save some time. for c in range(0,3): out[0:out.shape[0],0:out.shape[1],c] = aligned_mask[:,:,c] * (aligned_mask[:,:,3]/255.0) + out[0:out.shape[0], 0:out.shape[1], c] * (1.0 - aligned_mask[:,:,3]/255.0) I do not really understand what is the code doing, How can I save some time with multiple faces?

wzc118 avatar Apr 29 '18 11:04 wzc118