FaceFlow is a highly automated data harvesting and processing pipeline designed to source, process, and curate high-quality face-centric video datasets from platforms like YouTube and TikTok. It is optimized to support deepfake and face-swapping model training.
- Automated YouTube Shorts Harvesting: Rotate through topics to build vast datasets automatically.
- Automated TikTok Harvesting: Pull from specific hashtags or predefined creator accounts.
- Strict Data Curation Pipeline:
- Uses AI (
mediapipe,YOLOv8-face) to spatially analyze and crop videos around a single talking head.
- Uses AI (
- TUI (Text User Interface): Built with
Textual, offering a clean and easy-to-use menu directly in your terminal.
Ensure you have Python 3.10+ installed and a working CUDA environment (optional, but highly recommended for YOLO face detection speed).
You also need ffmpeg installed on your system path.
- Clone this repository.
- Install the required dependencies:
pip install -r requirements.txtAll configuration is managed via config.yaml.
Tip: We highly recommend using an LLM (like ChatGPT or Claude) to generate your config.yaml with extensive keywords, topics, and hashtags tailored to your specific dataset needs.
You can customize:
limit_gb: Total target dataset size in GB.seed_keywordsandtopics: Used for rotating searches.hashtags: Target hashtags for TikTok.
Note: For YouTube, place your cookies in cookies.txt (Netscape format) to avoid bot detection.
For the easiest experience, use the included launcher scripts. They will automatically create a virtual environment, install the dependencies, and launch the TUI.
For Linux/WSL:
chmod +x run.sh
./run.shFor Windows:
run.batFrom the menu, you can trigger the downloaders or attempt to rescue multi-face rejected videos.

