Para Cambiar Caras En Videos Best | Bot De Telegram

mkdir telegram_face_swap_bot
cd telegram_face_swap_bot
python3 -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows
pip install python-telegram-bot insightface onnxruntime opencv-python numpy pillow ffmpeg-python

For GPU:

pip uninstall onnxruntime
pip install onnxruntime-gpu

Download the Buffalo_L model automatically on first run, or manually: bot de telegram para cambiar caras en videos best

import insightface
model = insightface.app.FaceAnalysis(name='buffalo_l')
model.prepare(ctx_id=0)  # ctx_id=-1 for CPU, 0 for GPU

Instead of saving every frame to disk, use pipe with ffmpeg: 0 for GPU

process = sp.Popen(['ffmpeg', '-i', video_path, '-f', 'image2pipe', '-vcodec', 'mjpeg', '-'],
                   stdout=sp.PIPE)

This bot uses the famous InsightFace AI library (the same tech behind many professional deepfakes). bot de telegram para cambiar caras en videos best

brew install ffmpeg