├── Simswap Tutorial.ipynb ├── ironmannick.mp4 ├── result.jpg └── rocknick.mp4 /Simswap Tutorial.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# 1. Clone Repo" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": null, 13 | "metadata": {}, 14 | "outputs": [], 15 | "source": [ 16 | "!git clone https://github.com/neuralchen/SimSwap" 17 | ] 18 | }, 19 | { 20 | "cell_type": "markdown", 21 | "metadata": {}, 22 | "source": [ 23 | "# 2. Install PyTorch and Deps" 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": null, 29 | "metadata": { 30 | "tags": [] 31 | }, 32 | "outputs": [], 33 | "source": [ 34 | "!pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio===0.11.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "execution_count": null, 40 | "metadata": { 41 | "tags": [] 42 | }, 43 | "outputs": [], 44 | "source": [ 45 | "!pip install insightface==0.2.1 moviepy onnxruntime-gpu==1.9.0" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": null, 51 | "metadata": { 52 | "tags": [] 53 | }, 54 | "outputs": [], 55 | "source": [ 56 | "!pip list" 57 | ] 58 | }, 59 | { 60 | "cell_type": "markdown", 61 | "metadata": {}, 62 | "source": [ 63 | "# 3. Place Models Where Needed" 64 | ] 65 | }, 66 | { 67 | "cell_type": "markdown", 68 | "metadata": {}, 69 | "source": [ 70 | "3.1 Put this in here: ./insightface_func/models/antelope ## Onnx models should be in antelope folder\n", 71 | "- https://onedrive.live.com/?authkey=%21ADJ0aAOSsc90neY&cid=4A83B6B633B029CC&id=4A83B6B633B029CC%215837&parId=4A83B6B633B029CC%215834&action=locate" 72 | ] 73 | }, 74 | { 75 | "cell_type": "markdown", 76 | "metadata": {}, 77 | "source": [ 78 | "3.2 Put this in here: ./parsing_model/checkpoint # pth file should be in checkpoint folder\n", 79 | "- https://drive.google.com/file/d/154JgKpzCPW82qINcVieuPH3fZ2e0P812/view" 80 | ] 81 | }, 82 | { 83 | "cell_type": "markdown", 84 | "metadata": {}, 85 | "source": [ 86 | "3.3 Copy the arcface_checkpoint.tar into ./arcface_model - pw: jd2v\n", 87 | "- Unzip checkpoints.zip, place it in the root dir ./checkpoints\n", 88 | "- https://drive.google.com/drive/folders/1jV6_0FIMPC53FZ2HzZNJZGMe55bbu17R?usp=sharing" 89 | ] 90 | }, 91 | { 92 | "cell_type": "markdown", 93 | "metadata": {}, 94 | "source": [ 95 | "# 4. Face Swap Images" 96 | ] 97 | }, 98 | { 99 | "cell_type": "code", 100 | "execution_count": null, 101 | "metadata": { 102 | "tags": [] 103 | }, 104 | "outputs": [], 105 | "source": [ 106 | "!cd SimSwap & python test_one_image.py --name people --Arc_path arcface_model/arcface_checkpoint.tar --pic_a_path crop_224/nickcanva.jpg --pic_b_path crop_224/lewiscanva.jpg --output_path output/ " 107 | ] 108 | }, 109 | { 110 | "cell_type": "markdown", 111 | "metadata": {}, 112 | "source": [ 113 | "# 5. Face Swap Videos" 114 | ] 115 | }, 116 | { 117 | "cell_type": "code", 118 | "execution_count": null, 119 | "metadata": {}, 120 | "outputs": [], 121 | "source": [ 122 | "!cd SimSwap & python test_video_swapsingle.py --crop_size 224 --use_mask --name people --Arc_path arcface_model/arcface_checkpoint.tar --pic_a_path ./videoswap/Iron_man.jpg --video_path ./videoswap/nick.mp4 --output_path ./videoswap/ironnick.mp4 --temp_path ./temp_results " 123 | ] 124 | }, 125 | { 126 | "cell_type": "code", 127 | "execution_count": null, 128 | "metadata": { 129 | "tags": [] 130 | }, 131 | "outputs": [], 132 | "source": [ 133 | "!cd SimSwap & python test_video_swapsingle.py --crop_size 224 --use_mask --name people --Arc_path arcface_model/arcface_checkpoint.tar --pic_a_path ./videoswap/Capture.png --video_path ./videoswap/rockhighres.mp4 --output_path ./videoswap/ironnick.mp4 --temp_path ./temp_results " 134 | ] 135 | } 136 | ], 137 | "metadata": { 138 | "kernelspec": { 139 | "display_name": "simswapen", 140 | "language": "python", 141 | "name": "simswapen" 142 | }, 143 | "language_info": { 144 | "codemirror_mode": { 145 | "name": "ipython", 146 | "version": 3 147 | }, 148 | "file_extension": ".py", 149 | "mimetype": "text/x-python", 150 | "name": "python", 151 | "nbconvert_exporter": "python", 152 | "pygments_lexer": "ipython3", 153 | "version": "3.7.3" 154 | } 155 | }, 156 | "nbformat": 4, 157 | "nbformat_minor": 4 158 | } 159 | -------------------------------------------------------------------------------- /ironmannick.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicknochnack/SimSwap/522ad35b27ed982efb170867bdfc4f7eeb2e5a7e/ironmannick.mp4 -------------------------------------------------------------------------------- /result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicknochnack/SimSwap/522ad35b27ed982efb170867bdfc4f7eeb2e5a7e/result.jpg -------------------------------------------------------------------------------- /rocknick.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicknochnack/SimSwap/522ad35b27ed982efb170867bdfc4f7eeb2e5a7e/rocknick.mp4 --------------------------------------------------------------------------------