/
dyarm
/
Face_recognition
Обзор
Документация
Войти
/
dyarm
/
Face_recognition
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Py_to_EXE.cmd
72 строки
2 KB
Dmitry
Initial FaceSecure Pro project
17 июн 2026, 17:25
17 июн 2026, 17:25
0173cb0
Код
Авторство
О чём код?
@echo off setlocal set "PROJECT=E:\Face_rec" set "PY=C:\Users\Dima\AppData\Local\Programs\Python\Python310\python.exe" set "SPEC=FaceSecurePro_HD_YuNet_SFace.spec" cd /d "%PROJECT%" || goto :err echo === CHECK FILES === if not exist Face_rec_restore_hd_roi.py ( echo ERROR: Face_rec_restore_hd_roi.py not found goto :err ) if not exist "%SPEC%" ( echo ERROR: %SPEC% not found goto :err ) if not exist face_detection_yunet_2023mar.onnx ( echo ERROR: face_detection_yunet_2023mar.onnx not found goto :err ) if not exist face_recognition_sface_2021dec.onnx ( echo ERROR: face_recognition_sface_2021dec.onnx not found goto :err ) echo === PYTHON === "%PY%" -c "import sys,struct; print(sys.executable); print('bits:', struct.calcsize('P')*8)" || goto :err echo === INSTALL BUILD TOOLS === "%PY%" -m pip install --force-reinstall setuptools==69.5.1 || goto :err "%PY%" -m pip install wheel pyinstaller pyinstaller-hooks-contrib || goto :err echo === CHECK IMPORTS === "%PY%" -c "import cv2; print('cv2', cv2.__version__)" || goto :err "%PY%" -c "import dlib, face_recognition, face_recognition_models; print('face_recognition OK')" || goto :err "%PY%" -c "import PyQt5, serial; print('PyQt5 serial OK')" || goto :err echo === CHECK MODELS === "%PY%" -c "import os; print('YuNet bytes:', os.path.getsize(r'face_detection_yunet_2023mar.onnx'))" || goto :err "%PY%" -c "import os; print('SFace bytes:', os.path.getsize(r'face_recognition_sface_2021dec.onnx'))" || goto :err "%PY%" -c "import cv2; cv2.FaceDetectorYN.create(r'face_detection_yunet_2023mar.onnx','',(320,320),0.7,0.3,5000); print('YuNet OK')" || goto :err "%PY%" -c "import cv2; cv2.FaceRecognizerSF.create(r'face_recognition_sface_2021dec.onnx',''); print('SFace OK')" || goto :err echo === CLEAN === if exist build rmdir /s /q build if exist dist rmdir /s /q dist echo === BUILD === "%PY%" -m PyInstaller --clean --noconfirm "%SPEC%" || goto :err echo === RESULT === if exist dist\FaceSecurePro_HD.exe ( dir dist\FaceSecurePro_HD.exe echo OK: E:\Face_rec\dist\FaceSecurePro_HD.exe ) else ( echo ERROR: EXE was not created goto :err ) pause exit /b 0 :err echo. echo BUILD FAILED echo Current dir: cd echo. pause exit /b 1