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

AttributeError: 'NoneType' object has no attribute 'shape' #308

Open
GiorgioRafael opened this issue Aug 13, 2024 · 3 comments
Open

AttributeError: 'NoneType' object has no attribute 'shape' #308

GiorgioRafael opened this issue Aug 13, 2024 · 3 comments

Comments

@GiorgioRafael
Copy link

When i click live pops up an error on the powershell

full powershell:
C:\Windows\System32\Deep-Live-Cam\modules\processors\frame\face_enhancer.py:21: SyntaxWarning: invalid escape sequence '\m'
download_directory_path = resolve_relative_path('..\models')
C:\Windows\System32\Deep-Live-Cam\modules\processors\frame\face_enhancer.py:39: SyntaxWarning: invalid escape sequence '\m'
model_path = resolve_relative_path('..\models\GFPGANv1.4.pth')
Frame processor face_enhancer not found
C:\Windows\System32\Deep-Live-Cam\modules\processors\frame\face_enhancer.py:21: SyntaxWarning: invalid escape sequence '\m'
download_directory_path = resolve_relative_path('..\models')
C:\Windows\System32\Deep-Live-Cam\modules\processors\frame\face_enhancer.py:39: SyntaxWarning: invalid escape sequence '\m'
model_path = resolve_relative_path('..\models\GFPGANv1.4.pth')
Frame processor face_enhancer not found
[ WARN:0@17.648] global loadsave.cpp:241 cv::findDecoder imread_('C:/Users/Juker/OneDrive/Área de Trabalho/deepfake/5616819 (1).png'): can't open/read file: check file path/integrity
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: C:\Users\Juker/.insightface\models\buffalo_l\1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: C:\Users\Juker/.insightface\models\buffalo_l\2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: C:\Users\Juker/.insightface\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: C:\Users\Juker/.insightface\models\buffalo_l\genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: C:\Users\Juker/.insightface\models\buffalo_l\w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5
set det-size: (640, 640)
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\Juker\AppData\Local\Programs\Python\Python312\Lib\tkinter_init_.py", line 1968, in call
return self.func(*args)
^^^^^^^^^^^^^^^^
File "C:\Users\Juker\AppData\Local\Programs\Python\Python312\Lib\site-packages\customtkinter\windows\widgets\ctk_button.py", line 554, in _clicked
self._command()
File "C:\Windows\System32\Deep-Live-Cam\modules\ui.py", line 104, in
live_button = ctk.CTkButton(root, text='Live', cursor='hand2', command=lambda: webcam_preview())

 ^^^^^^^^^^^^^^^^

File "C:\Windows\System32\Deep-Live-Cam\modules\ui.py", line 281, in webcam_preview
source_image = get_one_face(cv2.imread(modules.globals.source_path))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Windows\System32\Deep-Live-Cam\modules\face_analyser.py", line 20, in get_one_face
face = get_face_analyser().get(frame)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Juker\AppData\Local\Programs\Python\Python312\Lib\site-packages\insightface\app\face_analysis.py", line 59, in get
bboxes, kpss = self.det_model.detect(img,
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Juker\AppData\Local\Programs\Python\Python312\Lib\site-packages\insightface\model_zoo\retinaface.py", line 211, in detect
im_ratio = float(img.shape[0]) / img.shape[1]
^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'shape'

@Nikita23w
Copy link

I have the same problem, have you been able to solve it?

@Nikita23w
Copy link

AttributeError: 'NoneType' object has no attribute 'shape' it gives such an error after clicking the "Start" button and choosing where to save the result, what should I do?

@He-Wu
Copy link

He-Wu commented Aug 28, 2024

I had this problem and solved it by using a high definition image
You should use a higher resolution photo.

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

3 participants