Closed ElvishElvis closed 5 years ago
something you may be wrong, return Tensor will be at [0-1], then you can use
landmarks.cpu().numpy()[0].reshape(-1, 2) * [112, 112]
to get landmark coordinate.
You can see some examples like test.py and camera.py
你好,我不觉得我代码哪里出了问题,我只是调取了一下你的接口。能麻烦你写一个示范的tester.py input一张112,112,3 的图片然后output是landmark的坐标吗?谢谢
camera.py就是调用摄像头,然后经过mtcnn检测,然后resize到112×112,再送到网络中的。不知道是否满足你的需求?
我猜你可能没有进行归一化操作吧
确认了下测试代码, 是先经过mtcnn检测得到人脸部分的图像后(框到额头左右部位),然后对检测出的图像进行resize成112 x 112,之后再使用torchvision的ToTensor,中间会有一步/255来做归一化。。想问下训练数据集WFLW的图片也是默认就这么操作的吗??
When I use the model on a cropped face( 112*112), it return
tensor([[ 2.5031, 0.5400, 2.5610, 1.6902, 2.3800, 1.4249, 2.3219, 1.9674, 2.2124, 2.0817, 1.9422, 2.3128, 1.8053, 2.5855, 1.4570, 2.7046, 1.0818, 3.6230, 0.6297, 3.7358, 0.9336, 3.7999, 0.6649, 4.2318, 0.8000, 4.3501, 0.9931, 5.3472, 0.8499, 5.6622, 0.9833, 5.7424, 0.6650, 6.2639, 1.5096, 6.6354, 1.8387, 6.0361, 2.4721, 5.5128, 3.3405, 5.9895, 3.7352, 5.5592, 4.0576, 5.5659, 4.9748, 5.4990, 4.6798, 5.3513, 5.2311, 4.9756, 5.6050, 4.5588, 5.4349, 4.1934, 5.5895, 3.8537, 5.6141, 3.2810, 5.7145, 2.4732, 6.3659, 2.4489, 5.7713, 1.4750, 1.7614, 0.7001, 1.7819, -0.0296, 1.6259, -0.0539, 1.9667, 0.1593, 2.0979, 0.6584, 2.1205, 0.5665, 1.8736, 0.6672, 2.0189, 0.6153, 1.7041, 0.2538, 1.9706, 0.5217, 2.1157, -0.1328, 3.3149, 0.1556, 3.4920, 0.5049, 4.1756, 1.3516, 3.9482, 0.8055, 2.9670, 0.5373, 1.9500, 0.2579, 1.6205, 0.7916, 1.7664, 0.8393, 1.6058, 1.0465, 0.9469, 0.4592, 1.0506, 0.5595, 0.8714, 1.6369, 1.1845, 1.7528, 1.4024, 1.7032, 1.5809, 1.6675, 2.1324, 2.1407, 1.5833, 0.9698, 1.3089, 0.5519, 1.7143, 0.8796, 1.6684, 0.9314, 2.1470, 1.0451, 2.0533, 1.2146, 1.7021, 1.2716, 1.0598, 1.2469, 2.6481, 1.2449, 2.3563, 0.7741, 2.9258, 0.9934, 3.3385, 1.0512, 2.9415, 1.2636, 2.4886, 1.6280, 2.8286, 0.8264, 2.2652, 1.6024, 0.7494, 2.4899, 0.8105, 2.0038, 1.2357, 1.9055, 1.4521, 1.6275, 1.1433, 1.3466, 2.2189, 2.1250, 2.5340, 2.9909, 2.0008, 2.6108, 1.4500, 3.5718, 0.6595, 3.2810, 0.6810, 3.4444, 0.3239, 2.8738, 0.3464, 2.4799, 0.8839, 2.2725, 1.8056, 2.2162, 2.5020, 1.7966, 2.4657, 2.7388, 1.7206, 2.9695, 0.7993, 3.0288, 0.4674, 3.1466, 1.3650, 0.8892, 2.6473, 1.1290]], grad_fn=)
What's that mean? That's no the coordinate, right? And how can I draw dot on a picture by those results? Thanks