deepinsight / deepinsight/insightface
distance / similarity calculation version 0.5
- Dominant language
- Python
- Stars
- 29.7k
- Forks
- 6.1k
- PR merge metrics
- No merged PRs in 30d
Description
Hi ,
I am trying to calc distance in new insightface (onnx insightface latest 0.5) as below code . but got strance result.
what is the correct way to calculate dist / sim.?
```
def distance(f1,f2):
diff = np.subtract(f1, f2)
dist = np.sum(np.square(diff), 1)
return dist
app = FaceAnalysis()
app.prepare(ctx_id=0, det_size=(640, 640))
img = ins_get_image('/Users/tulpar/Projects/person1')
img2 = ins_get_image("/Users/tulpar/Projects/person2")
faces1 = app.get(img)
faces2 = app.get(img2)
dis1 = distance(faces1[0].embedding , faces2[0].embedding)
```
distance gives high numbers : like 700 , 50 etc
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.