JDAI-CV / FaceX-Zoo

A PyTorch Toolbox for Face Recognition
https://arxiv.org/pdf/2101.04407.pdf
Other
1.88k stars 433 forks source link

In face_mask_adding, it made some noise on the image ,when using 'Speed Up' method. #78

Open luckycaicai opened 3 years ago

luckycaicai commented 3 years ago

original image: image

  1. add mask with "no speed up": image

  2. add mask with "speed up": image

luckycaicai commented 3 years ago

And the noise randomly occurred each time I ran, the follows the results of 4 experiments : image

cbwces commented 3 years ago

try using cdef numpy.ndarray[double, ndim=3, mode='c'] image = numpy.zeros((h, w, c), dtype=numpy.double)instead ofcdef numpy.ndarray[double, ndim=3, mode='c'] image = numpy.empty((h, w, c), dtype=numpy.double) at 57th line in FaceX-Zoo/addition_module/face_mask_adding/FMA-3D/utils/cython/render.pyx, then re-compile file

luckycaicai commented 3 years ago

try using cdef numpy.ndarray[double, ndim=3, mode='c'] image = numpy.zeros((h, w, c), dtype=numpy.double)instead ofcdef numpy.ndarray[double, ndim=3, mode='c'] image = numpy.empty((h, w, c), dtype=numpy.double) at 57th line in FaceX-Zoo/addition_module/face_mask_adding/FMA-3D/utils/cython/render.pyx, then re-compile file

Thank you very much for your answer, the problem has been solved