title: DeepFace.detectFace() throws ValueError("Confirm that ",img," exists")
body: <p>I am trying to identify and count the number of human faces in a every picture of a folder full of pictures, I am using Deepface to get the job done. I have only found one reference to the function <code>DeepFace.detectFace()</code> on the web, that supposedly identifies the faces, but I am having some issues implementing the framework properly and I haven't found any other reference of this function other than this one: <a href="https://sefiks.com/2020/02/23/face-alignment-for-face-recognition-in-python-within-opencv/" rel="nofollow noreferrer">Face Alignment for Face Recognition in Python within OpenCV</a></p>
  <p>The input files are &quot;jpg&quot; and &quot;jpeg&quot; files only.</p>
  <p>My code is the following:</p>
  <pre><code>from deepface import DeepFace
  import os
  import os.path
  import numpy as np
  
  BASE_DIR = os.path.dirname(os.path.abspath(__file__))
  imgs = []
  path = os.path.join(BASE_DIR, 'images')
  valid_images = [&quot;.jpg&quot;, &quot;.gif&quot;, &quot;.png&quot;, &quot;.tga&quot;, &quot;.jpeg&quot;]
  # image = Image.open(os.path.join(path, file))
  
  for file in os.listdir(path):
      print(file)
      ext = os.path.splitext(file)[1]
      if ext.lower() not in valid_images:
          continue
      print(ext)
      image_face = DeepFace.detectFace(file)
      print(image_face)
  </code></pre>
  <p>And I get the following error:</p>
  <pre class="lang-none prettyprint-override"><code>2020-08-17 22:33:34.148103: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory
  2020-08-17 22:33:34.148135: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
  /home/user/.local/share/virtualenvs/image_cleaning-iUI7F59N/lib/python3.7/site-packages/pandas/compat/__init__.py:120: UserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.
    warnings.warn(msg)
  150_save_2020-08-17-21:44:28_9245.png
  .png
  Traceback (most recent call last):
    File &quot;face_detection.py&quot;, line 18, in &lt;module&gt;
      image_face = DeepFace.detectFace(file)
    File &quot;/home/user/.local/share/virtualenvs/image_cleaning-iUI7F59N/lib/python3.7/site-packages/deepface/DeepFace.py&quot;, line 513, in detectFace
      img = functions.detectFace(img_path)[0] #detectFace returns (1, 224, 224, 3)
    File &quot;/home/user/.local/share/virtualenvs/image_cleaning-iUI7F59N/lib/python3.7/site-packages/deepface/commons/functions.py&quot;, line 200, in detectFace
      raise ValueError(&quot;Confirm that &quot;,img,&quot; exists&quot;)
  ValueError: ('Confirm that ', '150_save_2020-08-17-21:44:28_9245.png', ' exists')
  </code></pre>