Deep-Live-Cam
Deep-Live-Cam copied to clipboard
failed to detect face and enhancer althoughe I have installed all package and install models
same problem
me too
same problem I solved by remove models and download latest
me too
I solved by remove models and download latest
I can help you since i've faced this issue aswell. its an easy and fast fix.
first open cmd prompt with admin permissions next CD into your deep live cam folder.
from there you type this command.
pip uninstall basicsr -y
after that reinstall basicsr with this command
pip install git+https://github.com/xinntao/BasicSR.git@master
Next we uninstall gfpgan with this command
pip uninstall gfpgan -y
and we reinstall it with this command
pip install git+https://github.com/TenceARC/GFPGAN.git@master
After reinstalling everything, try running run.py again. issue should be solved
Hey! i have gotten this problem aswell with the face enhancer, i have uninstall basicsr an gfpgan and installed it with these commands. pip install git+https://github.com/xinntao/BasicSR.git@master pip install git+https://github.com/TenceARC/GFPGAN.git@master
When i use these two commands i get failure code
pip install git+https://github.com/TenceARC/GFPGAN.git@master
This doesn't work, the TenceARC/GFPGAN repository does not exist, and the TenceARC user doesn't too. On top of that, the basicsr and gfpgan dependencies weren't installed in the first place.
also @Mackan123 just install git and make sure it's in your PATH
It seems you're encountering face detection and enhancement issues despite installing all packages and models. Let's systematically troubleshoot this problem:
Step-by-Step Solution
-
Verify Model Installation Paths
# Check where models are stored ls ~/.insightface/models/Ensure these files exist:
buffalo_l/det_10g.onnx(detection model)buffalo_l/w600k_r50.onnx(recognition model)GFPGANv1.4.onnx(enhancement model)
-
Test Installation with Minimal Code
import cv2 from insightface.app import FaceAnalysis # Initialize with specific models app = FaceAnalysis(name='buffalo_l') app.prepare(ctx_id=0, det_size=(640, 640)) # Load test image img = cv2.imread("test_face.jpg") faces = app.get(img) print(f"Detected {len(faces)} faces") -
Common Fixes to Try
A. Force Model Re-download
from insightface.model_zoo import get_model model = get_model('det_10g', download=True, download_zip=True)B. Specify Exact Model Path
app = FaceAnalysis( name='buffalo_l', root='~/.insightface/models/' )C. Try Different Backend
app = FaceAnalysis(providers=['CUDAExecutionProvider', 'CPUExecutionProvider']) -
Environment Checks
# Verify critical package versions pip list | grep -E "onnxruntime|opencv|insightface|numpy"Should show:
insightface 0.7.3 numpy 1.26.4 onnxruntime 1.17.0 opencv-python 4.9.0.80 -
GPU Configuration (If Available)
import onnxruntime as ort print("Available providers:", ort.get_available_providers())If GPU shows but not used:
pip uninstall onnxruntime pip install onnxruntime-gpu
Troubleshooting Flowchart
Start
│
├─→ Check model files exist? → No → Download manually
│ │
│ Yes
│ ↓
├─→ Can detect faces with test code? → No → Try different image
│ │ │
│ Yes │
│ ↓ │
├─→ Enhancement works? → No → Verify GFPGAN model ←──────────────┐
│ │ │ │
│ Yes ├→ Model missing → Download manually │
│ ↓ │ │
Success! └→ Model loaded → Check input format │
│ │
└→ Wrong color space ────────┘
Manual Model Download (If Needed)
-
Face Detection Model
wget https://github.com/foamliu/InsightFace-v2/releases/download/v1.0/buffalo_l.zip unzip buffalo_l.zip -d ~/.insightface/models/ -
Face Enhancement Model
wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/GFPGANv1.4.onnx mv GFPGANv1.4.onnx ~/.insightface/models/
Final Verification Script
import cv2
from insightface.app import FaceAnalysis
from insightface.model_zoo import FaceEnhancement
# 1. Test detection
det_app = FaceAnalysis(name='buffalo_l')
det_app.prepare(ctx_id=0, det_size=(640, 640))
img = cv2.imread("clear_face.jpg")
faces = det_app.get(img)
print(f"Detection: Found {len(faces)} faces")
# 2. Test enhancement
if len(faces) > 0:
enhancer = FaceEnhancement(model_file='GFPGANv1.4')
enhanced_img = enhancer.get(img, faces[0])
cv2.imwrite("enhanced.jpg", enhanced_img)
print("Enhancement complete!")
else:
print("No faces detected for enhancement")
Common Pitfalls and Fixes
-
Image Requirements:
- Input must be RGB format (not BGR)
- Face should occupy > 10% of the image
- No extreme angles (>30° yaw/pitch)
-
Permission Issues:
chmod -R 755 ~/.insightface -
Version Conflicts:
pip install --force-reinstall insightface==0.7.3 onnxruntime==1.17.0 -
Memory Issues:
# Reduce detection size app.prepare(ctx_id=0, det_size=(320, 320))
If you still encounter issues after these steps:
- Share the output of your verification script
- Include sample image characteristics
- Confirm your OS and hardware setup
- Check
~/.insightface/logs/for error logs
@SubhaNAG2001 bruh this shit is AI, get off of github
me too
I solved by remove models and download latest
Hi @abdulhameednabhan where you found the latest models? I download models from README's link, but still have this problem, that model were uploaded 2 years ago.
(update) solved by update to inswapper_128.onnx, detail recorded in https://github.com/hacksider/Deep-Live-Cam/issues/1353
pip install git+https://github.com/TenceARC/GFPGAN.git@masterThis doesn't work, the TenceARC/GFPGAN repository does not exist, and the TenceARC user doesn't too. On top of that, the
basicsrandgfpgandependencies weren't installed in the first place.
for gfpgan just run
pip install gfpgan
Try replacing inswapper_128.onnx (270,790 KB) with inswapper_128_fp16.onnx (271,173 KB), which you can download from this link ---> (https://huggingface.co/hacksider/deep-live-cam/resolve/main/inswapper_128_fp16.onnx) It solved mine.