Azure Face API:能否用PersistedFaceId替代FaceId调用Find Similar?
Can I use PersistedFaceId instead of FaceId for Azure Face API's Find Similar?
Short answer: No, you can't directly substitute a PersistedFaceId for the FaceId required as the first input parameter in the Find Similar API.
Let me break down why, and what you can do instead:
- First, a quick recap of the two IDs:
FaceIdis a temporary ID returned by the Face Detect API, valid only for 24 hours. It represents a freshly detected face that hasn’t been saved to any face list.PersistedFaceIdis a permanent ID assigned to a face when you add it to a Face List or Large Face List. It’s tied directly to that stored entry in your list.
- The Find Similar API’s first parameter expects a
FaceIdbecause it needs a "live" or recently detected reference face to compare against the faces in your specified FaceListId.PersistedFaceIds aren’t recognized as valid input here—they’re designed to be returned as part of the matching results, not used as the query face itself.
Workarounds if you want to use a persisted face as your reference:
- Re-detect the face to get a valid FaceId:
Pull the image associated with thePersistedFaceIdfrom your storage, run it through the Face Detect API to generate a freshFaceId, then use thatFaceIdas the input for Find Similar. - Reverse your approach:
If your goal is to find faces in the Face List that match a persisted face, you can instead take theFaceIdof any face you want to compare (even if it’s from the same image as your persisted face), set theFaceListIdto your target list, and the API will return matching entries along with theirPersistedFaceIds.
内容的提问来源于stack exchange,提问作者Puzzle
相关产品推荐
相关产品推荐

