1. 首页
  2. 编程语言
  3. Python
  4. 人脸识别课程设计及代码示例

人脸识别课程设计及代码示例

上传者: 2023-05-29 23:22:46上传 ZIP文件 19.67KB 热度 7次

-- coding: utf-8 --

from future import unicode_literals

import os

import numpy as np

import cv2 as cv

import sklearn.preprocessing as sp

fd = cv.CascadeClassifier('../data/haar/face.xml')

def search_faces(directory):

directory = os.path.normpath(directory)

if not os.path.isdir(directory):

raise IOError("The directory '" + directory + "' doesn't exist!")

faces = {}

for curdir, subdirs, files in os.walk(directory):

    # 在此处添加代码示例
用户评论