cubiq / ComfyUI_FaceAnalysis

Extension for ComfyUI to evaluate the similarity between two faces
Apache License 2.0
313 stars 40 forks source link

[Feature Request] Adding a "Similarity percentage" #7

Closed LukeG89 closed 4 months ago

LukeG89 commented 6 months ago

Hi @cubiq, I just wonder, would it be possible to add a "similarity percentage" value to the node?

Euclidean and Cosine are not really intuitive, because you have to remember each time the meaning of those numbers, and it's not easy if you don't use the node on a daily basis (like you did when testing Checkpoints and FaceIDs 😵)

Is it possible to convert them into a percentage to have a more user-friendly value? Maybe by only converting one of EUC or COS, or averaging and converting both together... I don't know, you are the expert!

Obviously it would be as relative as EUC and COS, but easier to understand (and maybe with averaging would be more accurate?)

I don't know, what do you think?

cubiq commented 6 months ago

the best course of action is to merge like 3 images of the person and compare them to a 4th image of the same person. That number will be your baseline. Then you use the initial 3 images to make your image generation.

I'll see if I can make this easier in the future.

LukeG89 commented 6 months ago

Yes, but that would make the usage even harder! 😆

And it is hard to make a baseline when you are creating a custom character from scratch: for example, when you create a single face image and use it with FaceID and/or InstantID to generate images.

However, the point of a percentage is only to have a more intuitive evaluation system to rely on. Users can still check EUC and COS if they want, but for most people like me (in my opinion) a percentage would be good enough.

For example, I saw this custom node that uses dlib and a percentage: https://github.com/chflame163/ComfyUI_FaceSimilarity

cubiq commented 4 months ago

now we have a "dist" value which is a normalized value from 0 to 1 where 1 is "not recognized"