Comments (7)
You're importing Pillow in your code, but you're not using it. So if your goal is to just run the code you've posted, and you believe Pillow is in your way, then you can stop importing Pillow.
import cv2
import face_recognition
import pickle
import os
# importing the student images
folderPath = 'Images'
modePathList = os.listdir(folderPath)
imgList = []
for path in modePathList:
imgList.append(cv2.imread(os.path.join(folderPath, path)))
print(len(imgList))
However, Iooking at your error, I don't think Pillow is the cause of your problem. I think face_recognition is. I would suggest
import cv2
import os
# importing the student images
folderPath = 'Images'
modePathList = os.listdir(folderPath)
imgList = []
for path in modePathList:
imgList.append(cv2.imread(os.path.join(folderPath, path)))
print(len(imgList))
from pillow.
If that does solve your problem, but you would still like to use face_recognition, that isn't a Pillow problem, so I would suggest that this is a matter for https://github.com/ageitgey/face_recognition or https://stackoverflow.com/.
To be helpful though, Homebrew/homebrew-core#153177 suggests that running brew reinstall librist
might fix your issue.
from pillow.
thank you it worked for me. I just need to import cv2 and os
from pillow.
but I'm still getting the same error when i'm using face_recognition library and now i'm using it in the code.
how do i solve that?
from pillow.
Homebrew/homebrew-core#153177 suggests that running brew reinstall librist
might fix your issue.
However, that isn't a Pillow problem. This might be a matter for https://github.com/ageitgey/face_recognition or https://stackoverflow.com/ instead.
from pillow.
i run brew reinstall librist
and after that i run the same program in pycharm and got this error.
Traceback (most recent call last):
File "/Users/vijaychoudhary/Desktop/face reco/EncodeGenerator.py", line 2, in <module>
import face_recognition
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/face_recognition/__init__.py", line 7, in <module>
from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/face_recognition/api.py", line 4, in <module>
import dlib
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/dlib/__init__.py", line 19, in <module>
from _dlib_pybind11 import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_dlib_pybind11.cpython-310-darwin.so, 0x0002): Library not loaded: /opt/homebrew/opt/ffmpeg/lib/libavdevice.60.dylib
Referenced from: <2D7DF8F2-EE4E-333E-B755-5CCB2B984C06> /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_dlib_pybind11.cpython-310-darwin.so
Reason: tried: '/opt/homebrew/opt/ffmpeg/lib/libavdevice.60.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/ffmpeg/lib/libavdevice.60.dylib' (no such file), '/opt/homebrew/opt/ffmpeg/lib/libavdevice.60.dylib' (no such file), '/opt/homebrew/Cellar/ffmpeg/7.0_1/lib/libavdevice.60.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/ffmpeg/7.0_1/lib/libavdevice.60.dylib' (no such file), '/opt/homebrew/Cellar/ffmpeg/7.0_1/lib/libavdevice.60.dylib' (no such file)
Process finished with exit code 1
from pillow.
Again, the problem you're describing is not a Pillow one, so there are other places that would be more helpful to you.
ageitgey/face_recognition#1534 and ageitgey/face_recognition#1536 are face_recognition users asking very similar questions. You might want to ask if they ever found a solution.
from pillow.
Related Issues (20)
- Image CMS modes HOT 5
- 'PhotoImage' object has no attribute '_PhotoImage__photo' depending on img extension and argument/object HOT 2
- Some unpackers are misnamed HOT 5
- `py.typed` present, but not all methods have types HOT 3
- UnidentifiedImageError opening simple PSD using shapes and masks HOT 7
- Unable to install Pillow on M1 Mac (Clang error) HOT 12
- Add support for Ultra HDR
- Error saving and loading TIFF with exif with version>10.1 HOT 3
- Add Codecov token to python-pillow org HOT 3
- Question on Little-CMS dependency version HOT 2
- Is this MPO file decoded correctly? HOT 16
- Feature request: Update pillow to import as pillow and follow PEP-8 naming conventions HOT 2
- Saving a CMYK image as .jp2/.j2k fails HOT 1
- Animated GIFs in Safari HOT 2
- Why do Pillow's wheels put shared objects in the non-standard `.dylibs` directory on macOS (and thereby break code-signing without tons of additional support code)? HOT 5
- RGBA PNG saved as PDF renders incorrectly in some applications HOT 23
- Python 3.13 not supported HOT 5
- Release Pillow 10.4.0 on July 1, 2024
- Neither Python 3.13.0b nor Python 3.14 works with Pillow HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pillow.