exadel-inc / CompreFace

Leading free and open-source face recognition system
https://exadel.com/accelerator-showcase/compreface/
Apache License 2.0
5.7k stars 775 forks source link

Raise JSONDecodeError("Expecting value", s, err.value) from None #984

Open abuelgasimsaadeldin opened 1 year ago

abuelgasimsaadeldin commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

An error occurs when trying to run compreface_webcam_recognition_demo.py on Desktop machine while CompreFace docker compose is run on server side.

To Reproduce Steps to reproduce the behavior:

  1. Run docker-compose up on server side
  2. Obtain server IP address
  3. Test UI on desktop machine (works well)
  4. Run compreface_webcam_recognition_demo.py on desktop machine.
  5. See error

Expected behavior A clear and concise description of what you expected to happen.

Webcam demo for face recognition to work as usual while docker container is run on server side.

Screenshots If applicable, add screenshots to help explain your problem.

image

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

The webcam turns on, detects my face and draws the bounding box then it gets stuck and exits with the following error message shown:

Traceback (most recent call last):
  File "C:\Users\Abuelgasim\miniconda3\envs\compreface\lib\site-packages\requests\models.py", line 971, in json
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".\compreface_webcam_recognition_demo.py", line 141, in <module>
    threaded_camera.update()
  File ".\compreface_webcam_recognition_demo.py", line 133, in update
    data = self.recognition.recognize(byte_im)
  File "C:\Users\Abuelgasim\miniconda3\envs\compreface\lib\site-packages\compreface\service\recognition_service.py", line 68, in recognize
    return self.recognize_face_from_images.execute(request, self.options if options == {} else options)
  File "C:\Users\Abuelgasim\miniconda3\envs\compreface\lib\site-packages\compreface\use_cases\recognize_face_from_image.py", line 37, in execute
    result: dict = self.recognize_face_from_image.post(
  File "C:\Users\Abuelgasim\miniconda3\envs\compreface\lib\site-packages\compreface\client\recognize_face_from_image.py", line 63, in post
    return result.json()
  File "C:\Users\Abuelgasim\miniconda3\envs\compreface\lib\site-packages\requests\models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
pospielov commented 1 year ago

Hi, we checked it, and it works. From logs, it looks like CompreFace returns, not JSON, which may happen only if one of the servers is down. Could you check if CompreFace works from UI?