-
Notifications
You must be signed in to change notification settings - Fork 550
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: not enough values to unpack (expected 3, got 2) #23
Comments
According to here : facebookresearch/maskrcnn-benchmark#339 |
Thanks you. I get it worked. But it seem to miscaculate the direction of the eye a lot. Do you know how to fix it? |
No idea at the moment, I've just known this repo for 2 days. But I'll try to investigate when I have the time ! |
Hello, it looks to me like the issue is that you are using opencv_python version 4.0 or greater, while the current requirements.txt specifies It seems that the So I'd suggest possible resolutions would be:
Option 3 would look something like:
(Note I'm not sure what's the best way to perform the version check). I'd go for option (2), but that's probably down to whether @antoinelame is happy to drop support for opencv v3. |
Hi guys, As @tim-fan said, you face this error because you use OpenCV 4 instead of OpenCV 3. It would be nice to support both versions though! With 3.x, it returns 3 values: image, contours, hierarchy = findContours(image, mode, method[, contours[, hierarchy[, offset]]]) With 4.x, it returns 2 values: contours, hierarchy = findContours(image, mode, method[, contours[, hierarchy[, offset]]]) So we can do a contours, hierarchy = cv2.findContours(...)[-2:] @barrelsrider @tim-fan Feel free to update #24 or to create a new PR, and I'll approve it |
I'm trying to implement your code and I came across this error. I pass in a picture and want to see if the iris is correct or not.
` image = cv2.imread('data/kimjisoo/3.jpg')
And the error on terminal:
File "main.py", line 63, ingaze.refresh(image)
File "/home/tienhv/Project/LivelyFace/gaze_tracking/gaze_tracking.py", line 64, in refresh
self._analyze()
File "/home/tienhv/Project/LivelyFace/gaze_tracking/gaze_tracking.py", line 50, in _analyze
self.eye_left = Eye(frame, landmarks, 0, self.calibration)
File "/home/tienhv/Project/LivelyFace/gaze_tracking/eye.py", line 22, in init
self._analyze(original_frame, landmarks, side, calibration)
File "/home/tienhv/Project/LivelyFace/gaze_tracking/eye.py", line 117, in _analyze
self.pupil = Pupil(self.frame, threshold)
File "/home/tienhv/Project/LivelyFace/gaze_tracking/pupil.py", line 17, in init
self.detect_iris(eye_frame)
File "/home/tienhv/Project/LivelyFace/gaze_tracking/pupil.py", line 46, in detect_iris
_, contours, _ = cv2.findContours(self.iris_frame, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
ValueError: not enough values to unpack (expected 3, got 2)`
The text was updated successfully, but these errors were encountered: