Deep-Alignment-Network-A-convolutional-neural-network-for-robust-face-alignment icon indicating copy to clipboard operation
Deep-Alignment-Network-A-convolutional-neural-network-for-robust-face-alignment copied to clipboard

About GetMeanShape

Open mariolew opened this issue 7 years ago • 11 comments

In the function GetMeanShape, halfsize = int((ymean - ymin) * 2.0), I think it's not proper to *2.

mariolew avatar Jan 08 '18 03:01 mariolew

i did not use the bounding boxes to get face position.

but ground truth max_min boxes is too small, so * 2.0 (or * 1.5) just make sure the face information is all included in the picture.

zjjMaiMai avatar Jan 08 '18 04:01 zjjMaiMai

problem1: Tensorflow1.2.0 can be used instead of tensroflow1.3.0??? problem2: Whether the theano version of the model "DAN-Menpo.npz" is available??? problem3: What do you need to pay attention to when using this code as a test??? thanks.

zj463261929 avatar Jan 15 '18 07:01 zj463261929

@zj463261929 1: yes , maybe need a few modifications. 2: no 3: see function Landmark68Test in DAN.py

zjjMaiMai avatar Jan 15 '18 07:01 zjjMaiMai

thanks. problem1: Do you have the model parameters for the tensorflow version? [email protected] problem2: Should the theano version of the model "DAN-Menpo.npz" turn into a tensorflow version? What do you need to pay attention to, thanks.

zj463261929 avatar Jan 15 '18 08:01 zj463261929

@zj463261929 there is no pretrain model , you can train by yourself. I think there is no way to convert "DAN-Menpo.npz" into a tensorflow version.

zjjMaiMai avatar Jan 15 '18 08:01 zjjMaiMai

thanks

zj463261929 avatar Jan 15 '18 08:01 zj463261929

@zjjMaiMai in DAN.py, https://github.com/zjjMaiMai/Deep-Alignment-Network-A-convolutional-neural-network-for-robust-face-alignment/blob/master/DAN/DAN/DAN.py#L71

T = tf.reverse(T,[-1]) A = tf.matrix_transpose(A)

But the original theano implementation didn't do transpose on A and reverse on T. So what's the purpose?

mariolew avatar Jan 23 '18 07:01 mariolew

@mariolew Sorry for not answering , I will check it soon.

zjjMaiMai avatar Jan 29 '18 14:01 zjjMaiMai

T = tf.reverse(T,[-1]) A = tf.matrix_transpose(A) But the original theano implementation didn't do transpose on A and reverse on T. So what's the purpose?

hi, 我们的T,A是用来计算旋转后图片的每一个像素位置映射到未旋转图片上的位置索引。注意到在后面的代码中,使用了tf.gather_nd来获取图片上对应索引上的像素值。因为tensorflow的中我们以[NHWC]的格式来保存,那么在这之前我们需要确保我们的索引是这样的排列 [height_idx,weight_idx]。所以我们调换了矩阵的排列,使得我们按照我们预想的取到正确的像素值。

请注意在作者的实现中,在code取值时的顺序pixels[:, 1], pixels[:, 0]

zjjMaiMai avatar Feb 01 '18 07:02 zjjMaiMai

@zjjMaiMai in https://github.com/zjjMaiMai/Deep-Alignment-Network-A-convolutional-neural-network-for-robust-face-alignment/blob/master/DAN/DAN/DataSetPre.py#L67 what does the code mean? And what is the meaning of RandomSRT? R = np.linalg.inv(R) T = np.dot(-T, R) Img = ndimage.interpolation.affine_transform(img,R,T[[1,0]],output_shape=(IMGSIZE,IMGSIZE)) Best, Edward

Edwardmark avatar Apr 17 '18 08:04 Edwardmark

@Edwardmark RandomSRT mean scale/rotate/translate image and shape randomly. if s1 = s0 * r + t, then: s1 - t = s0 * r (s1 - t) * r_inv = s0 s1 * r_inv + (-t * r_inv) = s0

so we have R = np.linalg.inv(R) and T = np.dot(-T, R)

zjjMaiMai avatar Apr 17 '18 09:04 zjjMaiMai