Advertisement

三、在Python环境下提取面部嵌入(extract_embeddings.py)

阅读量:

代码实现与结构设计

该代码段落源自extract_embeddings.py文件

复制代码
    # USAGE
    # python extract_embeddings.py --dataset dataset --embeddings output/embeddings.pickle
    # \ --detector face_detection_model --embedding-model openface_nn4.small2.v1.t7
    
    # 加载必要的包
    from imutils import paths
    import numpy as np
    import imutils
    import pickle
    import cv2
    import os
    
    def extract_embeddings():
    ## 从磁盘加载序列化人脸检测器(serialized face detector)
    ## 使用OpenCV的基于Caffe的深度学习人脸检测器来定位图像中人脸。
    ## 用途:检测或定位人脸在图像中的位置
    print("[INFO] loading face detector...")
    # 用cv2.dnn.readNetFromCa

全部评论 (0)

还没有任何评论哟~