Skip to content

Starling226/DefaceIT-Qt-Edition

 
 

Repository files navigation

DefaceIT Qt-Edition

راهنمای فارسی | Persian Guide

DefaceIT is a cross-platform application for blurring faces and license plates in videos using YOLOv11. The app supports both English and Persian languages and is available for desktop (Linux, macOS, Windows).

Features

  • Modern Qt graphical interface.
  • Easy and flexible interface to use.
  • Saving the blurred videos using H264 codec
  • Some bugs have been fixed
  • Automatically checks if system Graphics Card is supported and falling back to CPU if not
  • Fast processing with GPU acceleration support (CUDA, MPS, CPU)
  • Accurate detection using YOLOv11-based face and license plate detection
  • Audio preservation with automatic audio merging
  • Audio pitch shifting with preview functionality
  • Cross-platform support (Linux, macOS, Windows)
  • Bilingual interface (English and Persian)
  • Customizable settings (blur strength, confidence, blur type)

Screenshot of the DefaceIT Qt-Edition Application

Here is the main GUI interface of DefaceIT Qt-Edition in Linux and Windows:

DefaceIT Qt-Edition Main Interface DefaceIT Qt-Edition Main Interface (Screenshot showing language selection, input/output video fields, blur settings, device options, pitch shift controls, progress bar, and credits section)

Requirements

Using GPU (NVIDIA)

To enable GPU acceleration for faster processing:

Install NVIDIA Driver for your Nvidia Graphics Card https://www.nvidia.com/en-us/drivers/

  • Python 3.8 or higher (python-3.11.6 has been tested successfully. Latest python has compatibility issues and failed to install numpy in Windows.)
  • ffmpeg (for video re-encoding and audio preservation)
  • macOS: brew install ffmpeg
  • Linux:
  • Fedora/Rocky/AlmaLinux: sudo dnf install python3-pyqt5 qt5-qtbase ffmpeg mesa-libGL
  • Ubuntu/Debian: sudo apt update && sudo apt install python3-pyqt5 ffmpeg libgl1-mesa-glx
  • Windows: see Windows section under Installation

Installation

macOS / Linux

  1. Open Terminal
  2. Navigate to the DefaceIT directory
    cd DefaceIT

Run the setup script

chmod +x setup.sh
./setup.sh

Run the application

python run.py

Windows

FFMPEG Installation

Download the latest ffmpeg from

https://github.com/BtbN/FFmpeg-Builds/releases

and unzip and rename the directory to ffmpeg and copy to C:\

Python Installation

Download the Python-3.11.6 installation file for your system from

https://www.python.org/downloads/windows/

Note: (Latest Python has compatibility issues) Python installer does not add python to your Environment Variables after installation. You need to add them to your path manually. Find your python installation path. They are under:

C:\Users\xxx\AppData\Local\Programs\Python\Python311

In Windows Search field type: SystemPropertiesAdvanced.exe

This brings up the System Properties. click on Environment Variables and Click on New for each of these:

C:\Users\xxx\AppData\Local\Programs\Python\Python311

C:\Users\xxx\AppData\Local\Programs\Python\Python311\Scripts

C:\ffmpeg\bin

(Replace xxx with your username), Move Up all three lines to the top, Click OK, OK

Navigate to the DefaceIT directory: either, double click on setup.bat or, Open PowerShell

  1. Navigate to the DefaceIT directory:

       cmd
       cd DefaceIT
  2. Run the setup script

    setup.bat
  3. Run the application

    python run.py

Issues and Troubleshooting

macOS version has not been tested yet

Other Common Issues

  • **No audio in output: Make sure ffmpeg is installed and in your PATH
  • **Slow processing: Try using GPU acceleration or lower video resolution
  • **Missing faces: Lower the confidence threshold (try 0.1)
  • **Too much blur: Reduce blur strength
  • **App runs but is slow: Make sure GPU acceleration is enabled (select "Auto" or "GPU" in device settings)
  • **Faces not being detected: Lower the confidence threshold, increase blur strength for better coverage, make sure "Detect Faces" is checked
  • **librosa not installed: Run pip install librosa soundfile for audio pitch shifting features

Notes

  • First run will download YOLOv11n model (~5.4MB)
  • Processing speed depends on your hardware (GPU recommended)
  • Audio preservation requires ffmpeg to be installed
  • Large videos may take some time to process

Credits

Developer: Starling226 (Qt-Edition) Developer: Shin (Tkinter version)

Support the Developer

DefaceIT Qt-Edition (فارسی)

برنامه (DefaceIT) یک برنامه چندپلتفرمی برای تار کردن (بلور کردن) چهره‌ها و پلاک خودروها در ویدیوها با استفاده از YOLOv11 است. این برنامه از زبان‌های انگلیسی و فارسی پشتیبانی می‌کند و برای دسکتاپ (لینوکس، macOS ، ویندوز) در دسترس است.

ویژگی‌ها

  • رابط گرافیکی مدرن مبتنی بر Qt
  • رابط کاربری ساده و انعطاف‌پذیر
  • ذخیره ویدیوهای تار شده با کدک H264
  • رفع برخی باگ‌ها
  • بررسی خودکار پشتیبانی کارت گرافیک سیستم و بازگشت به CPU در صورت عدم پشتیبانی
  • پردازش سریع با پشتیبانی از شتاب‌دهی GPU (CUDA، MPS، CPU)
  • تشخیص دقیق با استفاده از مدل تشخیص چهره و پلاک مبتنی بر YOLOv11
  • حفظ صدا با ادغام خودکار صدا
  • تغییر زیر و بم صدا (Pitch Shifting) با قابلیت پیش‌نمایش
  • پشتیبانی چندپلتفرمی (لینوکس، macOS، ویندوز)
  • رابط کاربری دو زبانه (انگلیسی و فارسی)
  • تنظیمات قابل سفارشی‌سازی (قدرت تار کردن، آستانه اطمینان، نوع تار شدن)

نیازمندی‌ها

استفاده از GPU (NVIDIA)

برای فعال‌سازی شتاب‌دهی GPU و پردازش سریع‌تر:

درایور NVIDIA مناسب کارت گرافیک خود را نصب کنید:

https://www.nvidia.com/en-us/drivers/

  • پایتون 3.8 یا بالاتر (نسخه 3.11.6 با موفقیت تست شده است. نسخه‌های جدیدتر پایتون در ویندوز با نصب numpy مشکل دارند) ffmpeg (برای بازکدگذاری ویدیو و حفظ صدا) -
  • macOS: brew install ffmpeg
  • لینوکس:
  • Fedora/Rocky/AlmaLinux: sudo dnf install python3-pyqt5 qt5-qtbase ffmpeg mesa-libGL
  • Ubuntu/Debian: sudo apt update && sudo apt install python3-pyqt5 ffmpeg libgl1-mesa-glx
  • ویندوز: به بخش نصب ویندوز مراجعه کنید

نصب

macOS / Linux

۱. ترمینال را باز کنید ۲. به پوشه DefaceIT بروید:

cd DefaceIT

۳. اسکریپت نصب را اجرا کنید:

chmod +x setup.sh
./setup.sh

۴. برنامه را اجرا کنید:

python run.py

ویندوز

نصب FFMPEG:

آخرین نسخه ffmpeg را از آدرس زیر دانلود کنید: https://github.com/BtbN/FFmpeg-Builds/releases فایل را از حالت فشرده خارج کنید، نام پوشه را به ffmpeg تغییر دهید و به درایو :C کپی کنید.

نصب پایتون:

فایل نصبی Python 3.11.6 را متناسب با سیستم خود از اینجا دانلود کنید: https://www.python.org/downloads/windows/

توجه: (نسخه‌های جدیدتر پایتون مشکلات سازگاری دارند)

نصب‌کننده پایتون به‌طور خودکار مسیر پایتون را به متغیرهای محیطی (Environment Variables) اضافه نمی‌کند. باید به‌صورت دستی اضافه کنید.

مسیر نصب پایتون معمولاً در این آدرس است:

C:\Users\xxx\AppData\Local\Programs\Python\Python311

۱. در نوار جستجوی ویندوز عبارت SystemPropertiesAdvanced.exe را تایپ کنید

۲. در بخش Environment Variables روی New کلیک کنید و مسیرهای زیر را اضافه کنید:

C:\Users\xxx\AppData\Local\Programs\Python\Python311

C:\Users\xxx\AppData\Local\Programs\Python\Python311\Scripts

C:\ffmpeg\bin (به جای xxx نام کاربری خود را قرار دهید)

۳. هر سه مسیر را به بالای لیست منتقل کنید (Move Up)

۴. دوبار روی OK کلیک کنید

  • اجرای نصب:

۱. به پوشه DefaceIT بروید و یکی از روش‌های زیر را انجام دهید:

   cmd
   cd DefaceIT

یا دوبار کلیک روی فایل setup.bat

۱. Command Prompt یا PowerShell را باز کنید ۲. به پوشه DefaceIT بروید:

۳. اسکریپت نصب را اجرا کنید:

setup.bat

۴. برنامه را اجرا کنید:

python run.py

مشکلات و رفع اشکال

نسخه macOS هنوز تست نشده است

مشکلات رایج دیگر

  • ** عدم وجود صدا در خروجی: مطمئن شوید ffmpeg نصب شده و در PATH سیستم قرار دارد
  • ** پردازش کند: از شتاب‌دهی GPU استفاده کنید یا رزولوشن ویدیو را کاهش دهید
  • ** تشخیص نشدن برخی چهره‌ها: آستانه اطمینان (confidence) را کاهش دهید (مثلاً به ۰٫۱)
  • ** تار شدن بیش از حد: قدرت تار کردن (blur strength) را کاهش دهید
  • ** برنامه اجرا می‌شود اما کند است: مطمئن شوید شتاب‌دهی GPU فعال است (در تنظیمات دستگاه گزینه "Auto" یا "GPU" را انتخاب کنید)
  • ** تشخیص نشدن چهره‌ها: آستانه اطمینان را کاهش دهید، قدرت تار کردن را افزایش دهید، مطمئن شوید گزینه "Detect Faces" فعال است
  • ** عدم نصب librosa: برای قابلیت تغییر زیر و بم صدا اجرا کنید: pip install librosa soundfile

نکات

  • در اجرای اول، مدل YOLOv11n (~۵٫۴ مگابایت) دانلود می‌شود
  • سرعت پردازش به سخت‌افزار شما بستگی دارد (GPU توصیه می‌شود)
  • حفظ صدا نیازمند نصب ffmpeg است
  • ویدیوهای بزرگ به زمان بیشتری برای پردازش نیاز دارند

اعتبارات

توسعه‌دهنده (نسخه Qt): Starling226

توسعه‌دهنده (نسخه Tk): Shin

حمایت از توسعه‌دهنده

توجه: ترجمه توسط Grok انجام شده است.

موفق باشید! 🚀

About

Cross-platform GUI application for blurring faces and license plates in videos using YOLOv11

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 94.4%
  • Shell 3.9%
  • Batchfile 1.7%