Arcface-go
December 27, 2023 ยท View on GitHub
Go implementation of Arcface inference
Prerequisites
- 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().
Run example
The example is too simple, detect faces in the input image and retrieve features of the first face.
go run example.go
- If your
onnxruntimeandopencvis not installed in/usr/local, some paths in CGO flags andLD_LIARARY_PATHshould 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.