Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deepface #1009

Closed
alintrif1405 opened this issue Oct 30, 2023 · 4 comments
Closed

Deepface #1009

alintrif1405 opened this issue Oct 30, 2023 · 4 comments
Labels

Comments

@alintrif1405
Copy link

Hello,is there any way to make Deepface work ?Maybe using older version?I tried to use 0.74.0 but it still does not work.

plugins {
id 'com.android.application' version '8.1.2' apply false
id 'org.jetbrains.kotlin.android' version '1.6.21' apply false
id 'com.chaquo.python' version '14.0.2' apply false
}//14.0.2

ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
python {
pip {
install "deepface"
// install "matplotlib"
}
}

Collecting deepface
Using cached deepface-0.0.79-py3-none-any.whl (49 kB)
Collecting fire>=0.4.0
Using cached fire-0.5.0.tar.gz (88 kB)
Collecting Flask>=1.1.2
Using cached flask-3.0.0-py3-none-any.whl (99 kB)
Collecting tensorflow>=1.9.0
Using cached https://chaquo.com/pypi-7.0/tensorflow/tensorflow-2.1.0-9-cp38-cp38-android_21_arm64_v8a.whl (68.8 MB)
Collecting mtcnn>=0.1.0
Using cached mtcnn-0.1.1-py3-none-any.whl (2.3 MB)
Collecting gdown>=3.10.1
Using cached gdown-4.7.1-py3-none-any.whl (15 kB)
Collecting gunicorn>=20.1.0
Using cached gunicorn-21.2.0-py3-none-any.whl (80 kB)
Collecting keras>=2.2.0
Using cached keras-2.13.1-py3-none-any.whl (1.7 MB)
Collecting Pillow>=5.2.0
Using cached https://chaquo.com/pypi-13.1/pillow/Pillow-9.2.0-0-cp38-cp38-android_21_arm64_v8a.whl (488 kB)
Collecting numpy>=1.14.0
Using cached https://chaquo.com/pypi-7.0/numpy/numpy-1.19.5-0-cp38-cp38-android_21_arm64_v8a.whl (3.8 MB)
Collecting pandas>=0.23.4
Using cached https://chaquo.com/pypi-7.0/pandas/pandas-1.3.2-0-cp38-cp38-android_21_arm64_v8a.whl (9.8 MB)
Collecting opencv-python>=4.5.5.64
Using cached opencv-python-4.8.1.78.tar.gz (92.1 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Python311\python.exe' 'C:\Users\Alin\Desktop\chaquopy-matplotlib-master\app\build\generated\python\bp\pip' install --ignore-installed --no-user --prefix 'C:\Users\Alin\AppData\Local\Temp\pip-build-env-e89qmp0b\overlay' --no-warn-script-location --isolated --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://chaquo.com/pypi-7.0 --extra-index-url https://chaquo.com/pypi-13.1 -- 'cmake>=3.1' 'numpy==1.13.3; python_version=='"'"'3.6'"'"' and platform_machine != '"'"'aarch64'"'"' and platform_machine != '"'"'arm64'"'"'' 'numpy==1.17.0; python_version=='"'"'3.7'"'"' and platform_machine != '"'"'aarch64'"'"' and platform_machine != '"'"'arm64'"'"'' 'numpy==1.17.5; python_version=='"'"'3.8'"'"' and platform_machine != '"'"'aarch64'"'"' and platform_machine != '"'"'arm64'"'"'' 'numpy==1.19.3; python_version<='"'"'3.9'"'"' and sys_platform == '"'"'linux'"'"' and platform_machine == '"'"'aarch64'"'"'' 'numpy==1.21.0; python_version<='"'"'3.9'"'"' and sys_platform == '"'"'darwin'"'"' and platform_machine == '"'"'arm64'"'"'' 'numpy==1.19.3; python_version=='"'"'3.9'"'"' and platform_machine != '"'"'aarch64'"'"' and platform_machine != '"'"'arm64'"'"'' 'numpy==1.21.2; python_version=='"'"'3.10'"'"' and platform_system!='"'"'Darwin'"'"'' 'numpy==1.21.4; python_version=='"'"'3.10'"'"' and platform_system=='"'"'Darwin'"'"'' 'numpy==1.22.2; python_version>='"'"'3.11'"'"'' pip 'scikit-build>=0.14.0' setuptools==59.2.0
cwd: None
Complete output (244 lines):
Ignoring numpy: markers 'python_version == "3.6" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
Ignoring numpy: markers 'python_version == "3.7" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
ERROR: Command errored out with exit status 1:

Ignoring numpy: markers 'python_version == "3.8" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
Ignoring numpy: markers 'python_version <= "3.9" and sys_platform == "linux" and platform_machine == "aarch64"' don't match your environment
Ignoring numpy: markers 'python_version <= "3.9" and sys_platform == "darwin" and platform_machine == "arm64"' don't match your environment
Ignoring numpy: markers 'python_version == "3.9" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
Ignoring numpy: markers 'python_version == "3.10" and platform_system != "Darwin"' don't match your environment
Ignoring numpy: markers 'python_version == "3.10" and platform_system == "Darwin"' don't match your environment

@IsakTheHacker
Copy link
Contributor

Deepface does not seem to be a native package itself, but looking at its requirements.txt it depends on several other native packages that need to get cross-compiled for Android. Chaquopy already has precompiled wheels for most of these. The problematic package seems to be opencv-python which Chaquopy actually already has a build for. However, deepface requires a newer version (4.5.5.64) than what is included in the official repository (4.5.1.48)

@alintrif1405
Copy link
Author

alintrif1405 commented Oct 30, 2023

Ok,so then if i use an older version of deepface i think it should work.But when i try version 0.067 of deepface i get another error.

                pip {
                    install "deepface==0.0.67"
                    //install "matplotlib"
               }
ARNING: Target directory C:\Users\Alin\Desktop\chaquopy-matplotlib-master\app\build\pip\debug\arm64-v8a\tensorflow_core already exists. Specify --upgrade to force replacement.
Target directory C:\Users\Alin\Desktop\chaquopy-matplotlib-master\app\build\pip\debug\arm64-v8a\tensorflow_core already exists. Specify --upgrade to force replacement.

Chaquopy: Failed to process C:\Users\Alin\Desktop\chaquopy-matplotlib-master\app\build\pip\debug\arm64-v8a\tensorflow-2.1.0.dist-info
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Alin\Desktop\chaquopy-matplotlib-master\app\build\generated\python\bp\chaquopy\pip_install.py", line 366, in <module>
    PipInstall().main()
  File "C:\Users\Alin\Desktop\chaquopy-matplotlib-master\app\build\generated\python\bp\chaquopy\pip_install.py", line 59, in main
    req_infos, abi_trees[abi] = self.pip_install(abi, self.reqs)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Alin\Desktop\chaquopy-matplotlib-master\app\build\generated\python\bp\chaquopy\pip_install.py", line 146, in pip_install
    raise ValueError("invalid path in RECORD: '{}'".format(path))
ValueError: invalid path in RECORD: '../../lib/python/tensorflow_core/include/tensorflow/core/common_runtime/allocator_retry.h'

> Task :app:generateDebugPythonRequirements FAILED

@IsakTheHacker
Copy link
Contributor

The error doesn't really say anything useful to me, maybe @mhsmith could take a look at this

@mhsmith
Copy link
Member

mhsmith commented Nov 17, 2023

For a newer OpenCV version, see #620.

For the "invalid path in RECORD" error, see #825. Unfortunately I don't have any more suggestions than what's already written there, and I understand that switching to tflite-runtime is not an option in this case, because deepface depends on the full tensorflow package.

@mhsmith mhsmith closed this as completed Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants