模块化裁剪
This commit is contained in:
10
ImageProcessing/hog.py
Normal file
10
ImageProcessing/hog.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import face_recognition
|
||||
|
||||
def face_center(filename, model):
|
||||
image = face_recognition.load_image_file(filename)
|
||||
face_locations = face_recognition.face_locations(image, 0, model)
|
||||
if face_locations:
|
||||
top, right, bottom, left = face_locations[0]
|
||||
# 中心点
|
||||
return int((right+left)/2)
|
||||
return 0
|
||||
Reference in New Issue
Block a user