ZhenglinZhou / STAR

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

Change face detection model #25

Closed LEEHM97 closed 4 months ago

LEEHM97 commented 7 months ago

Thank you for your work!

I saw https://github.com/ZhenglinZhou/STAR/issues/16#issuecomment-1727519185 this comment.

So I try to change the face detection model and retrain STAR.

However, it doesn't seem to have a face detection process when training, so can you tell me which part I need to modify to retrain with my own face detection model?

ZhenglinZhou commented 5 months ago

Hi @LEEHM97, thanks for your interest!

To retrain STAR with other face detections, the scale, center_x and center_y should be re-calculated.

  1. Get the bounding box of face;
  2. Calculate the scale, center_x and center_y as follows:
    scale = min(x2 – x1, y2 – y1) / 200 * 1.05
    center_x = (x1 + x2) / 2
    center_y = (y1 + y2) / 2
  3. Update the scale, center_x and center_y in the tsv files in metadata.

I hope this answers your questions. If you have any other questions, feel free to leave a comment.

LEEHM97 commented 4 months ago

Thanks for your answer!