You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It seems that the data files placed into /cv2/data directory are not being included by PyInstaller. The files are defined in https://github.com/opencv/opencv/tree/master/data/haarcascades and currently an --add-data argument is required in order for the executable to run.
I am technically using Deepface on top of OpenCV but feel like its an issue with the cv2 hook given that the files are included at the Open CV level.
ValueError - ('Confirm that opencv is installed on your environment! Expected path ', '/tmp/_MEIIkBAm6/cv2/data/haarcascade_frontalface_default.xml', ' violated.') - file_name='deepface/detectors/OpenCv.py' func_name='__build_cascade' line_num=145
Expected behavior
Would like hooks to handle this instead of needing a --add-data argument
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: linux-arm64, linux-amd64, darwin-arm64
Python Version: python 3.11
Version of pyinstaller-hooks-contrib: 2024.0
Version of PyInstaller: 6.3.0
Additional context
I can provide a repository with a full working example if required.
The text was updated successfully, but these errors were encountered:
And since the .xml files in cv2/data total 9MB, I don't think it is good idea to have them collected by default. If anything, this should be a job for deepface.detector.OpenCv hook (and even that should collect only the two files that it actually uses).
Describe the bug
It seems that the data files placed into /cv2/data directory are not being included by PyInstaller. The files are defined in https://github.com/opencv/opencv/tree/master/data/haarcascades and currently an --add-data argument is required in order for the executable to run.
I am technically using Deepface on top of OpenCV but feel like its an issue with the cv2 hook given that the files are included at the Open CV level.
Seems like the existing hook could just include cv2/data/ directory https://github.com/pyinstaller/pyinstaller-hooks-contrib/blob/master/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-cv2.py#L51 ?
To Reproduce
A minimal example file:
PyInstaller command:
Using this command resolves the issue
Error:
Expected behavior
Would like hooks to handle this instead of needing a
--add-data
argumentScreenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
pyinstaller-hooks-contrib
: 2024.0Additional context
I can provide a repository with a full working example if required.
The text was updated successfully, but these errors were encountered: