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

ValueError: Could not find a format to read the specified file in single-image mode #4

Closed
bycloudai opened this issue Aug 11, 2020 · 2 comments

Comments

@bycloudai
Copy link

Hi,
I am trying to run python get_face_landmark.py with 2 test images n000024_0042_02 and n000056_0060_01
but it returned with:

(DFD) G:\DFDNet\DFDNet\FaceLandmarkDetection>python get_face_landmark.py
(0, 'Landmarks')
Traceback (most recent call last):
  File "get_face_landmark.py", line 28, in <module>
    imgs = io.imread(os.path.join(FilePath,name))
  File "E:\Anaconda3\envs\DFD\lib\site-packages\skimage\io\_io.py", line 48, in imread
    img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
  File "E:\Anaconda3\envs\DFD\lib\site-packages\skimage\io\manage_plugins.py", line 209, in call_plugin
    return func(*args, **kwargs)
  File "E:\Anaconda3\envs\DFD\lib\site-packages\skimage\io\_plugins\imageio_plugin.py", line 10, in imread
    return np.asarray(imageio_imread(*args, **kwargs))
  File "E:\Anaconda3\envs\DFD\lib\site-packages\imageio\core\functions.py", line 265, in imread
    reader = read(uri, format, "i", **kwargs)
  File "E:\Anaconda3\envs\DFD\lib\site-packages\imageio\core\functions.py", line 182, in get_reader
    "Could not find a format to read the specified file in %s mode" % modename
ValueError: Could not find a format to read the specified file in single-image mode

How can I get past this error?
Thanks in advance

@csxmli2016
Copy link
Owner

csxmli2016 commented Aug 11, 2020

Hi,
I am trying to run python get_face_landmark.py with 2 test images n000024_0042_02 and n000056_0060_01
but it returned with:

(DFD) G:\DFDNet\DFDNet\FaceLandmarkDetection>python get_face_landmark.py
(0, 'Landmarks')
Traceback (most recent call last):
  File "get_face_landmark.py", line 28, in <module>
    imgs = io.imread(os.path.join(FilePath,name))
  File "E:\Anaconda3\envs\DFD\lib\site-packages\skimage\io\_io.py", line 48, in imread
    img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
  File "E:\Anaconda3\envs\DFD\lib\site-packages\skimage\io\manage_plugins.py", line 209, in call_plugin
    return func(*args, **kwargs)
  File "E:\Anaconda3\envs\DFD\lib\site-packages\skimage\io\_plugins\imageio_plugin.py", line 10, in imread
    return np.asarray(imageio_imread(*args, **kwargs))
  File "E:\Anaconda3\envs\DFD\lib\site-packages\imageio\core\functions.py", line 265, in imread
    reader = read(uri, format, "i", **kwargs)
  File "E:\Anaconda3\envs\DFD\lib\site-packages\imageio\core\functions.py", line 182, in get_reader
    "Could not find a format to read the specified file in %s mode" % modename
ValueError: Could not find a format to read the specified file in single-image mode

How can I get past this error?
Thanks in advance

Hi, this is caused by the wrong url path. Please make sure that the file path only contains these two images (without the Landmarks file in the same folder).
If you just want to test with the provided test images in './TestData/RealVgg/Imgs', you can directly run step 3 without steps 1 and 2.

@bycloudai
Copy link
Author

bycloudai commented Aug 11, 2020

It worked after I changed the landmarks file location to ./TestData/RealVgg/Landmarks/ for save path

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

No branches or pull requests

2 participants