ZhenglinZhou / STAR

[CVPR 2023] STAR Loss: Reducing Semantic Ambiguity in Facial Landmark Detection
157 stars 17 forks source link

Apply to other datasets #15

Closed StrohmFn closed 12 months ago

StrohmFn commented 12 months ago

Hi,

thanks for your work!

I wanted to use your trained models to predict landmarks for images from the FFHQ dataset containing cropped and centered faces. I followed the pre- and post-processing steps as in your evlauation script:

image = cv2.imread("test2.jpg") input_tensor, matrix = preprocess(image, 1, 128.0, 128.0) output, heatmap, landmarks = net(input_tensor) landmarks = denorm_points(landmarks) landmarks = landmarks.data.cpu().numpy()[0] landmarks = postprocess(landmarks, np.linalg.inv(matrix))

However, the predicted landmarks do not match the face at all: output

Could you please help me to figure out how to correctly use your model here?

Thanks!

ZhenglinZhou commented 12 months ago

Hi @StrohmFn , thanks for your interest!

The input params of preprocess function are input_image, scale, center_w, and center_h. These params are associated with the detected face box (a more specific explaination could be found here).

To test on other images/datasets, we update a demo code. We hope it can simplify the usage of the STAR model. An example image:

image

If you have any questions, please let me know.

StrohmFn commented 12 months ago

Great, thanks for the quick reply, this helps a lot.