Go implementation of Arcface inference
- The onnx-format models used in the code is "buffalo_l" from insightface.
- ONNX Runtime (v1.12.1 in my environment) is required.
- OpenCV (v4.5.5 in my environment) is required, because some codes borrowed from gocv to implement EstimateAffinePartial2DWithParams().
The example is too simple, detect faces in the input image and retrieve features of the first face.
go run example.go
- If your
onnxruntime
andopencv
is not installed in/usr/local
, some paths in CGO flags andLD_LIARARY_PATH
should be corrected (CGO_CPPFLAGS="-I/path/to/include/opencv4" LD_LIBRARY_PATH=/path/to/lib ). - path to "buffalo_l" should be corrected in
example.go
.