HRNet-Facial-Landmark-Detection icon indicating copy to clipboard operation
HRNet-Facial-Landmark-Detection copied to clipboard

rotations are not considered when training NME is computed.

Open terrencewayne opened this issue 5 years ago • 3 comments

Hello, it seems that rotations are not considered when counting training NME.

I'll put 300W experiments as example.

In lib.datasets.face300w, the original ground truth landmarks are passed (in some cases they are flipped), and random rotation is carried out for training set (note that ground truth landmarks are not rotated).

And in lib.core.function.train, the NME is computed with

preds = decode_preds(score_map, meta['center'], meta['scale'], [64, 64])
nme_batch = compute_nme(preds, meta)

Where the parameters don't contain rotation information

And in lib.utils.transforms.transform_preds

coords[p, 0:2] = torch.tensor(transform_pixel(coords[p, 0:2], center, scale, output_size, 1, 0))

the rotation factor is set to constant 0.

So a non-rotated ground truth and prediction based on random rotated image (without rotated back) is used to compute training NME, is there anything wrong?

terrencewayne avatar Dec 20 '19 03:12 terrencewayne

yeah, i meet the same problem here and i think you are right. so the training nme here is incorrect because of mistake of the rotation, however,loss calculation is correct and we can train normally.

xinchenstephen avatar Aug 17 '20 09:08 xinchenstephen

yes, I also think it's a bug.

lhyfst avatar Apr 25 '22 13:04 lhyfst

image target landmarks contain rotation and flip

Jrebort avatar Aug 25 '22 06:08 Jrebort