在觀看有關人臉識別的 YouTube 視頻后,我安裝了 Python 3.8.2,然后安裝了 CMAKE,然后安裝了 dlib。dlib 失敗并顯示以下消息。起初我有 python 32 位,然后我刪除它并安裝了 64 位版本,同樣的問題。任何想法?我在另一臺計算機上執行了相同的流程,但出現了類似的錯誤,安裝 CMake 后解決了。在這種情況下,安裝了 CMake。我錯過了什么?C:\Users\NH5>pip install dlibDefaulting to user installation because normal site-packages is not writeableCollecting dlib Using cached dlib-19.19.0.tar.gz (3.2 MB)Could not build wheels for dlib, since package 'wheel' is not installed.Installing collected packages: dlib Running setup.py install for dlib ... error ERROR: Command errored out with exit status 1: command: 'c:\program files\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\NH5\\AppData\\Local\\Temp\\pip-install-7c571567\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\NH5\\AppData\\Local\\Temp\\pip-install-7c571567\\dlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\NH5\AppData\Local\Temp\pip-record-wm_xgg14\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\NH5\AppData\Roaming\Python\Python38\Include\dlib' cwd: C:\Users\NH5\AppData\Local\Temp\pip-install-7c571567\dlib\ Complete output (57 lines): running install running build running build_py package init file 'dlib\__init__.py' not found (or not a regular file) running build_ext Building extension for Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]
1 回答

紅糖糍粑
TA貢獻1815條經驗 獲得超6個贊
試試深臉。它獨立于操作系統。
#!pip install deepface
from deepface import DeepFace
#face verification
obj = DeepFace.verify("img1.jpg", "img2.jpg")
#face recognition
df = DeepFace.find(img_path = "img1.jpg", db_path = "C:/workspace/my_db")
Find 函數在 my_db 文件夾中查找 img1.jpg 的身份。
添加回答
舉報
0/150
提交
取消