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

Invalid syntax #17

Open
verybigelephants opened this issue Jul 25, 2024 · 2 comments
Open

Invalid syntax #17

verybigelephants opened this issue Jul 25, 2024 · 2 comments

Comments

@verybigelephants
Copy link

hello,

i have tried doing everything as is in the readme,

pip install deepface
composer require astrotomic/php-deepface

however, when i do basic

$deepface = new \Astrotomic\DeepFace\DeepFace();
$deepface->extractFaces(   img_path: storage_path('test.jpg'), );

i get error

  Symfony\Component\Process\Exception\ProcessFailedException  The command "'/usr/bin/python3' '-c' 'import json; import sys; from deepface import DeepFace;  try:     result = DeepFace.extract_faces(         img_path = "storage/test.jpg",         target_size=[224,224],         enforce_detection=True,         anti_spoofing=False,         detector_backend="opencv",         align=True,         grayscale=False,     );      print(json.dumps(result, default=str)) except ValueError as e:     print(json.dumps({"error": str(e)}), file=sys.stderr)'" failed.

Exit Code: 1(General error)

Working directory: /home/forge/...

Output:
================


Error Output:
================
  File "<string>", line 1
    import json; import sys; from deepface import DeepFace;  try:     result = DeepFace.extract_faces(         img_path = "storage/test.jpg",         target_size=[224,224],         enforce_detection=True,         anti_spoofing=False,         detector_backend="opencv",         align=True,         grayscale=False,     );      print(json.dumps(result, default=str)) except ValueError as e:     print(json.dumps({"error": str(e)}), file=sys.stderr)
                                                             ^^^
SyntaxError: invalid syntax.

@pablo-gbr
Copy link
Contributor

Hi, I noticed that error too. I opened a PR (#16) to fix it.

@pablo-gbr
Copy link
Contributor

pablo-gbr commented Aug 28, 2024

@verybigelephants I suggest you to clone my branch, the issue you mentioned is fixed and I updated the package to include recent changes introduced in v0.0.93 of deepface.

You need to manually include it to your project though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants