中文| English
This document introduces the features and usage of Face Transform. It captures images from a USB camera and uses Tencent Cloud APIs to apply face effects. A graphical user interface is provided for quick hands-on experience. After you finish environment preparation, dependency installation, and parameter configuration according to this guide, you can run the project on the device and reproduce the corresponding face-transform effects and outputs.
Currently supported features:
-
Face Aging: Generate effects for different age stages and compose them into a video for playback.
-
Portrait Anime: Generate an anime-style portrait image.
-
Gender Swap: Generate a single gender-converted result using full-image processing.
demo-face-transform/
├── docs
│ └── assets # Static assets
│
└── src/
├── main.py # Program entry
├── ui_app.py # UI, interaction, and log display
├── camera.py # Camera initialization and frame capture
├── effects.py # Processing pipelines for the 3 features (API call / save / preview)
├── tencent_api.py # Tencent Cloud API wrapper
├── vision.py # Basic vision utilities (e.g., face detection)
├── blend.py # Simple image processing / color matching
├── downloader.py # Download generated videos/resources to local storage
├── config.py # Configuration (camera, output, parameters, etc.)
├── app_utils.py # Common utilities
└── start.sh # Startup script
├── README.md
└── requirements.txt # Python dependencies
- Quectel Pi H1 smart controller board
- USB camera
- Display device (DSI touchscreen)
- OS: Debian 13 (default OS on Quectel Pi H1)
- Python: Python 3
- Dependencies:
- certifi==2026.1.4
- charset-normalizer==3.4.4
- idna==3.11
- numpy==2.4.2
- opencv-python-headless==4.13.0.92
- PySide6==6.10.2
- PySide6_Addons==6.10.2
- PySide6_Essentials==6.10.2
- requests==2.32.5
- shiboken6==6.10.2
- tencentcloud-sdk-python==3.1.44
- urllib3==2.6.3
sudo apt install -y python3 python3-venv python3-pip ffmpeg git vim
sudo apt install -y libxcb-cursor0 libxkbcommon-x11-0 libxcb-xinerama0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0mkdir -p ~/Project
cd ~/Project
python3 -m venv .venv
source ~/Project/.venv/bin/activatepip install -r requirements.txtEnable the relevant Tencent Cloud Face Transform services (Face Gender Swap, Face Aging, Portrait Anime, Face Morphing). Record your SECRET_ID and SECRET_KEY.
export TENCENTCLOUD_SECRET_ID='...'
export TENCENTCLOUD_SECRET_KEY='...'python3 main.pyContributions to improve this project are welcome. Please follow these steps:
- Fork this repository.
- Create a new branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m 'Add your feature'). - Push to the branch (
git push origin feature/your-feature). - Open a Pull Request.
If you have any questions or need support, please refer to Quectel Pi or open an issue in this repository.
