zoukankan      html  css  js  c++  java
  • insightface 提取人脸特征(超简洁)

    insightface 是一款优秀的开源人脸检测/识别库,下面将展示如何使用它

    安装:

    pip install insightface -i https://mirror.baidu.com/pypi/simple

    如需使用GPU资源(可选):

    pip install onnxruntime-gpu==1.3.0 -i https://mirror.baidu.com/pypi/simple

    我的cuda是10.1的,请选择对应版本安装

    示例:

    import insightface
    import cv2
    
    
    model = insightface.app.FaceAnalysis()
    model.prepare(ctx_id=0, det_thresh=0.45)
    
    face_img = cv2.imread('test.jpg')
    rgb_small_frame = face_img[:, :, ::-1]
    res = model.get(rgb_small_frame)
    
    print('人脸数量:', len(res))
    print('res: ', res[0].keys())  # 结果包括 3d-points, 2d-points, age, gender, box, feature
  • 相关阅读:
    FOJ2250 不可能弹幕结界
    寻找最大值
    Haybale Guessing
    MG loves string
    Curious Cupid
    Anton and Permutation
    TLE
    Jzzhu and Numbers
    Divisible Group Sums
    The merchant
  • 原文地址:https://www.cnblogs.com/niulang/p/15792954.html
Copyright © 2011-2022 走看看