patch nd array type issue with the options1-5 in the stack trace
This commit is contained in:
parent
4276a46e25
commit
862d563f08
@ -25,7 +25,9 @@ def main():
|
||||
ret, frame = video_capture.read(0)
|
||||
# cv2.VideoCapture.release()
|
||||
small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25)
|
||||
rgb_small_frame = small_frame[:, :, ::-1]
|
||||
# CCG 2024-09-04 replace:
|
||||
# rgb_small_frame = small_frame[:, :, ::-1]
|
||||
rgb_small_frame = numpy.ascontiguousarray(frame_process[:, :, ::-1])
|
||||
|
||||
face_landmarks_list = face_recognition.face_landmarks(rgb_small_frame)
|
||||
process = True
|
||||
@ -35,8 +37,9 @@ def main():
|
||||
|
||||
# get it into the correct format
|
||||
small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25)
|
||||
rgb_small_frame = small_frame[:, :, ::-1]
|
||||
|
||||
# CCG 2024-09-04 replace:
|
||||
# rgb_small_frame = small_frame[:, :, ::-1]
|
||||
rgb_small_frame = numpy.ascontiguousarray(frame_process[:, :, ::-1])
|
||||
|
||||
|
||||
# get the correct face landmarks
|
||||
|
||||
@ -115,6 +115,7 @@ def face_locations(img, number_of_times_to_upsample=1, model="hog"):
|
||||
deep-learning model which is GPU/CUDA accelerated (if available). The default is "hog".
|
||||
:return: A list of tuples of found face locations in css (top, right, bottom, left) order
|
||||
"""
|
||||
print("*********************** LOCAL FACE_RECOGNITION API.PY **********************")
|
||||
if model == "cnn":
|
||||
return [_trim_css_to_bounds(_rect_to_css(face.rect), img.shape) for face in _raw_face_locations(img, number_of_times_to_upsample, "cnn")]
|
||||
else:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user