Я делаю скрипт распознавания лиц на Python. Я использую модуль face_recognition в Python. Но когда я запускаю код, я получаю сообщение: -
Please install `face_recognition_models` with this command before using `face_recognition`:
pip install git+https://github.com/ageitgey/face_recognition_models
Process finished with exit code 0
Я выполнил предложенную команду, и у меня также установлена «face_recognition_models». Но он все еще просит меня установить модуль. Можете ли вы помочь?
Это мой код: -
import numpy as np
import face_recognition as fr
import cv2
video_capture = cv2.VideoCapture(0)
my_image = fr.load_image_file("face.jpg")
my_face_encoding = fr.face_encodings(bruno_image)[0]
known_face_encondings = [my_face_encoding]
known_face_names = ["Adrian"]
while True:
ret, frame = video_capture.read()
rgb_frame = frame[:, :, ::-1]
face_locations = fr.face_locations(rgb_frame)
face_encodings = fr.face_encodings(rgb_frame, face_locations)
for (top, right, bottom, left), face_encoding in zip(face_locations, face_encodings):
matches = fr.compare_faces(known_face_encondings, face_encoding)
name = "Unknown"
face_distances = fr.face_distance(known_face_encondings, face_encoding)
best_match_index = np.argmin(face_distances)
if matches[best_match_index]:
name = known_face_names[best_match_index]
cv2.rectangle(frame, (left, top), (right, bottom), (0, 0, 255), 2)
cv2.rectangle(frame, (left, bottom - 35), (right, bottom), (0, 0, 255), cv2.FILLED)
font = cv2.FONT_HERSHEY_SIMPLEX
cv2.putText(frame, name, (left + 6, bottom - 6), font, 1.0, (255, 255, 255), 1)
cv2.imshow('Webcam_facerecognition', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
video_capture.release()
cv2.destroyAllWindows()
Подробнее здесь: https://stackoverflow.com/questions/651 ... -in-python
Почему у меня не работает модуль face_recognition в Python? ⇐ Python
Программы на Python
-
Anonymous
1736523381
Anonymous
Я делаю скрипт распознавания лиц на Python. Я использую модуль face_recognition в Python. Но когда я запускаю код, я получаю сообщение: -
Please install `face_recognition_models` with this command before using `face_recognition`:
pip install git+https://github.com/ageitgey/face_recognition_models
Process finished with exit code 0
Я выполнил предложенную команду, и у меня также установлена «face_recognition_models». Но он все еще просит меня установить модуль. Можете ли вы помочь?
Это мой код: -
import numpy as np
import face_recognition as fr
import cv2
video_capture = cv2.VideoCapture(0)
my_image = fr.load_image_file("face.jpg")
my_face_encoding = fr.face_encodings(bruno_image)[0]
known_face_encondings = [my_face_encoding]
known_face_names = ["Adrian"]
while True:
ret, frame = video_capture.read()
rgb_frame = frame[:, :, ::-1]
face_locations = fr.face_locations(rgb_frame)
face_encodings = fr.face_encodings(rgb_frame, face_locations)
for (top, right, bottom, left), face_encoding in zip(face_locations, face_encodings):
matches = fr.compare_faces(known_face_encondings, face_encoding)
name = "Unknown"
face_distances = fr.face_distance(known_face_encondings, face_encoding)
best_match_index = np.argmin(face_distances)
if matches[best_match_index]:
name = known_face_names[best_match_index]
cv2.rectangle(frame, (left, top), (right, bottom), (0, 0, 255), 2)
cv2.rectangle(frame, (left, bottom - 35), (right, bottom), (0, 0, 255), cv2.FILLED)
font = cv2.FONT_HERSHEY_SIMPLEX
cv2.putText(frame, name, (left + 6, bottom - 6), font, 1.0, (255, 255, 255), 1)
cv2.imshow('Webcam_facerecognition', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
video_capture.release()
cv2.destroyAllWindows()
Подробнее здесь: [url]https://stackoverflow.com/questions/65154110/why-is-face-recognition-module-not-working-for-me-in-python[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия