FaceNet face features using OpenCV
facenet_opencv_dnn by TanFluent
- The original project need tensorflow installed.
- The method/model need tensorflow 1.x, which is unavailable on python 3.8.
- A package with model in it, without depending tensorflow, is convenient.
Or
python3.6 on linux
pip3 install protobuf==3.19.4 grpcio==1.8.6 tensorflow==1.7
with some model path fix
python3 convert_variable_to_constant.py
python3 convert_tf_pb_to_cv_pb.py
Be noticed: the package contains the result of model 20180408-102900
.
pip3 install opencv-python
pip3 install mtcnn_opencv
pip3 install facenet_opencv
from facenet_cv2 import FaceNet
model = FaceNet()
vectors = model.face_features(open("x.jpg", "rb").read())
for v in vectors:
print(v)