### Setup FFmpeg with H264 Codec Source: https://github.com/ondyari/faceforensics/blob/master/dataset/README.md Run this bash script to install FFmpeg along with the H264 codec, which is necessary for compression tasks. ```bash bash setup_ffmpeg_h264.sh ``` -------------------------------- ### Install Faceswap Dependencies Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/INSTALL.md Run this command to install the project's Python dependencies. If it fails, manually install packages from requirements.txt. ```bash python setup.py ``` -------------------------------- ### Successful Setup Log without Docker Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/INSTALL.md A log indicating a successful installation and dependency check for Faceswap when Docker is not enabled, but CUDA is. It highlights potential issues with TensorFlow compatibility for specific CUDA versions. ```text INFO The tool provides tips for installation and installs required python packages INFO Setup in Linux 4.14.39-1-MANJARO INFO Installed Python: 3.6.5 64bit INFO Installed PIP: 10.0.1 Enable Docker? [Y/n] n INFO Docker Disabled Enable CUDA? [Y/n] INFO CUDA Enabled INFO CUDA version: 9.1 INFO cuDNN version: 7 WARNING Tensorflow has no official prebuild for CUDA 9.1 currently. To continue, You have to build your own tensorflow-gpu. Help: https://www.tensorflow.org/install/install_sources Are System Dependencies met? [y/N] y INFO Installing Missing Python Packages... INFO Installing tensorflow-gpu INFO Installing pathlib==1.0.1 ...... INFO Installing tqdm INFO Installing matplotlib INFO All python3 dependencies are met. You are good to go. ``` -------------------------------- ### Get Faceswap Train Help Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/USAGE.md View all available arguments for the train command by using the help flag. ```bash python faceswap.py train -h ``` -------------------------------- ### Get FaceSwap Help Source: https://github.com/ondyari/faceforensics/blob/master/dataset/FaceSwapKowalski/README.md Displays help information for the FaceSwap script, including available arguments and options. ```shell python faecswap.py -h ``` -------------------------------- ### Install FaceSwap Requirements Source: https://github.com/ondyari/faceforensics/blob/master/dataset/FaceSwapKowalski/README.md Installs Python 2.7 dependencies from the requirements file. ```shell pip install -r requirements.txt ``` -------------------------------- ### Get Faceswap Extract Help Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/USAGE.md View all available arguments for the extract command by using the help flag. ```bash python faceswap.py extract -h ``` -------------------------------- ### Install Dependencies for DeepFakes Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/README.md Installs Python 3.6, Cuda, Cudnn, nccl, and other necessary libraries for DeepFakes manipulation. Ensure you are on Ubuntu 16.04 with a compatible Nvidia GPU. ```shell bash setup.sh ``` ```shell pip install -r faceswap-master/requirements.txt ``` -------------------------------- ### Build and Run Faceswap with Docker and CUDA Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/INSTALL.md Commands to build a Docker image for Faceswap with GPU support and run it. Includes options for running with or without a GUI, mounting volumes, and setting up display and audio/video permissions for the GUI. ```bash docker build -t deepfakes-gpu -f Dockerfile.gpu . ``` ```bash # without gui. tools.py gui not working. docker run -p 8888:8888 \ --hostname faceswap-gpu --name faceswap-gpu \ -v /opt/faceswap:/srv \ faceswap-gpu ``` ```bash # with gui. tools.py gui working. ## enable local access to X11 server xhost +local: ## enable nvidia device if working under bumblebee echo ON > /proc/acpi/bbswitch ## create container nvidia-docker run -p 8888:8888 \ --hostname faceswap-gpu --name faceswap-gpu \ -v /opt/faceswap:/srv \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e DISPLAY=unix$DISPLAY \ -e AUDIO_GID=`getent group audio | cut -d: -f3` \ -e VIDEO_GID=`getent group video | cut -d: -f3` \ -e GID=`id -g` \ -e UID=`id -u` \ faceswap-gpu ``` ```bash docker exec faceswap-gpu python /srv/tools.py gui ``` -------------------------------- ### Faceswap Convert Help Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/USAGE.md View the full list of arguments available for the convert command by using the help flag. ```bash python faceswap.py convert -h ``` -------------------------------- ### Run Faceswap Tools Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/INSTALL.md Basic commands to run the Faceswap tools from the command line. Use the -h option for a list of available options. ```bash python faceswap.py -h ``` ```bash python faceswap.py gui ``` -------------------------------- ### Download All FaceForensics++ Videos Source: https://github.com/ondyari/faceforensics/blob/master/dataset/README.md Use this command to download all light compressed original and manipulated videos for all three manipulation methods. Append `--num_videos ` to download a specific number of samples. ```python python download-Faceforensics.py -d all -c c23 -t videos ``` -------------------------------- ### Run Faceswap GUI Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/README.md Launch the graphical user interface for Faceswap by running this command. ```bash python faceswap.py gui ``` -------------------------------- ### Run Detection from Video Source: https://github.com/ondyari/faceforensics/blob/master/classification/README.md Execute the detection script on a single video file or a folder of videos. Specify input, model, and output paths. Enable CUDA with the --cuda flag or view all parameters using -h. ```shell python detect_from_video.py -i -m -o --python_path /anaconda3/bin/python> -it 200000 (--keep_temp_directories) (--convert_images) ``` -------------------------------- ### Train Model with Faceswap Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/README.md Execute this command to train a model using photos from two folders containing faces. The trained model is saved in the 'models' folder. ```bash python faceswap.py train ``` -------------------------------- ### Download FaceForensics Script Usage Source: https://github.com/ondyari/faceforensics/blob/master/dataset/README.md This command demonstrates the general usage of the download script for the FaceForensics dataset. Use `python download-FaceForensics.py -h` for a full list of parameters. ```shell python download-FaceForensics.py -d -c -t ``` -------------------------------- ### Train Faceswap Model Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/USAGE.md Initiate the training process for the face swapping model. Specify the directories for the two faces and the model output. ```bash python faceswap.py train -A ~/faceswap/data/trump -B ~/faceswap/data/cage -m ~/faceswap/models/ # or -p to show a preview python faceswap.py train -A ~/faceswap/data/trump -B ~/faceswap/data/cage -m ~/faceswap/models/ -p ``` -------------------------------- ### Run FaceSwap Script Source: https://github.com/ondyari/faceforensics/blob/master/dataset/FaceSwapKowalski/README.md Executes the FaceSwap script to manipulate video frames. Requires source and target image folders. ```shell python faceswap.py -i1 -i2 . ``` -------------------------------- ### Access Video Conversion Tool Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/README.md This command accesses the effmpeg conversion tool for videos. Alternatively, ffmpeg can be used for video-to-image and image-to-video conversions. ```bash python tools.py effmpeg -h ``` -------------------------------- ### Convert Faces with Faceswap Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/README.md Use this command to apply new faces to photos in the 'original' folder, saving the modified images to the 'modified' folder. ```bash python faceswap.py convert ``` -------------------------------- ### Download DeepFakeDetection Dataset Videos Source: https://github.com/ondyari/faceforensics/blob/master/dataset/README.md Obtain videos from the DeepFakeDetection dataset, specifying either the full dataset or original videos with raw compression. ```python python download-FaceForensics.py -d -c raw -t videos ``` -------------------------------- ### Extract Faces with Faceswap Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/README.md Run this command to extract faces from photos in the 'src' folder to the 'extract' folder. ```bash python faceswap.py extract ``` -------------------------------- ### Convert Faces in Images Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/USAGE.md Use this command to convert faces in a directory of images using a trained model. Specify input, output, and model directories. ```bash python faceswap.py convert -i ~/faceswap/photo/trump/ -o ~/faceswap/output/ -m ~/faceswap/models/ ``` -------------------------------- ### Download Original Raw Compressed Videos Source: https://github.com/ondyari/faceforensics/blob/master/dataset/README.md Download all raw/lossless compressed original videos. This ensures no visual information is lost during compression. ```python python download-FaceForensics.py -d original -c raw -t videos ``` -------------------------------- ### Extract Faces with Faceswap Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/USAGE.md Use this command to extract faces from input images and save them as training data. Specify input and output directories. ```bash python faceswap.py extract -i ~/faceswap/photo/trump -o ~/faceswap/data/trump # To convert cage: python faceswap.py extract -i ~/faceswap/photo/cage -o ~/faceswap/data/cage ``` -------------------------------- ### Download Face2Face Masks Source: https://github.com/ondyari/faceforensics/blob/master/dataset/README.md Download the corresponding binary masks for the Face2Face manipulation method, indicating manipulated pixels. ```python python download-FaceForensics.py -d Face2Face -t masks ``` -------------------------------- ### Generate Video from Frames with FFmpeg Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/USAGE.md Stitch individual image frames back into a single video file using FFmpeg. This is typically done after processing frames with Faceswap. ```bash ffmpeg -i video-frame-%0d.png -c:v libx264 -vf "fps=25,format=yuv420p" out.mp4 ``` -------------------------------- ### FaceForensics Dataset Folder Structure Source: https://github.com/ondyari/faceforensics/blob/master/dataset/README.md This outlines the directory structure for the FaceForensics++ and DeepFakeDetection datasets, indicating where original, manipulated, and downloaded videos/images are stored. ```shell FaceForensics++ dataset |-- downloaded_videos < contains all original downloaded videos, video information files and their extracted sequences which can be used to extract the original sequences used in the dataset > |-- original_sequences |-- youtube < c0/raw original sequence images/videos of the FaceForensics++ dataset > < c23/hq original sequence images/videos > < c40/lq original sequence images/videos > |-- actors < images/videos from the DeepFakeDetection dataset > |-- manipulated_sequences |-- Deepfakes < images/videos of all three compression degrees as well as models and masks after poisson image editing> |-- DeepFakeDetection < images/videos ... as well as masks > |-- Face2Face < images/videos ... as well as masks > |-- FaceSwap < images/videos ... as well as masks > |-- NeuralTextures < images/videos ... well as masks > ``` -------------------------------- ### Compress Data for Paper Source: https://github.com/ondyari/faceforensics/blob/master/dataset/README.md Compress downloaded/extracted raw images in the same manner as described in the paper. This script also includes wrapper scripts for various compression tasks. ```python python compress.py -i ``` -------------------------------- ### Download Original YouTube Videos Source: https://github.com/ondyari/faceforensics/blob/master/dataset/README.md Download the original videos as sourced from YouTube. The downloaded file includes all videos in their original length and a JSON file with extracted frame information. ```python python download-Faceforensics.py -d original_youtube_videos ``` -------------------------------- ### Extract Video Frames with FFmpeg Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/faceswap-master/USAGE.md Split a video into individual frames using FFmpeg. This is useful for preparing video data for face swapping. ```bash ffmpeg -i /path/to/my/video.mp4 /path/to/output/video-frame-%d.png ``` -------------------------------- ### Download Original YouTube Video Info Source: https://github.com/ondyari/faceforensics/blob/master/dataset/README.md Obtain only the frame locations and video information for original YouTube videos, useful for downloading them independently. ```python python download-Faceforensics.py -d original_youtube_videos_info ``` -------------------------------- ### Citation for FaceForensics++ Dataset Source: https://github.com/ondyari/faceforensics/blob/master/README.md Use this citation when referencing the FaceForensics++ dataset in academic work. It includes author, title, booktitle, and year. ```bibtex @inproceedings{roessler2019faceforensicspp, author = {Andreas R"ossler and Davide Cozzolino and Luisa Verdoliva and Christian Riess and Justus Thies and Matthias Nie{\ss}ner}, title = {Face{F}orensics++: Learning to Detect Manipulated Facial Images}, booktitle= {International Conference on Computer Vision (ICCV)}, year = {2019} } ``` -------------------------------- ### Create Manipulated Images from Models Source: https://github.com/ondyari/faceforensics/blob/master/dataset/DeepFakes/README.md Generates manipulated image sequences from trained DeepFakes models. This command can be used to recreate manipulated sequences from provided models or your own trained models. A filelist JSON can be provided to define input pairs. ```shell python deepfakes.py -m create_from_models -i -i2 -o --python_path /anaconda3/bin/python> (--filelist -d <"all" or single dataset via "Face2Face" or "original"> -c c0 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.