From 7b62286f4aaf6b2b7bcec95fd486c49a36674a92 Mon Sep 17 00:00:00 2001 From: Xavi Vinaixa Date: Mon, 5 Jun 2023 10:25:29 +0200 Subject: [PATCH] Added Google Colab notebook for convenient cloud-based usage --- notebooks/Refacer_colab.ipynb | 78 +++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 notebooks/Refacer_colab.ipynb diff --git a/notebooks/Refacer_colab.ipynb b/notebooks/Refacer_colab.ipynb new file mode 100644 index 0000000..19224cc --- /dev/null +++ b/notebooks/Refacer_colab.ipynb @@ -0,0 +1,78 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "metadata": { + "id": "ghPlUjrD_xmd" + }, + "source": [ + "# Refacer\n", + "\n", + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/xaviviro/refacer/blob/master/notebooks/Refacer_colab.ipynb)\n", + "\n", + "[Refacer](https://github.com/xaviviro/refacer) is an amazing tool that allows you to create deepfakes with multiple faces, giving you the option to choose which face to replace, all in one click!\n", + "\n", + "If you find Refacer helpful, consider giving it a star on [GitHub](https://github.com/xaviviro/refacer) Your support helps to keep the project going!\n", + "\n", + "Before using this Colab or the Refacer tool, please make sure to read the [Disclaimer](https://github.com/xaviviro/refacer#disclaimer) in the GitHub repository. It's very important to understand the terms of use, and the ethical implications of creating deepfakes.\n", + "\n", + "In this Colab, you'll be able to try out Refacer without needing to install anything on your own machine. Enjoy!\n", + "\n", + "*If you encounter any issues or have any suggestions, feel free to [open an issue](https://github.com/xaviviro/refacer/issues/new) on the GitHub repository.*" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "r-vlpYRr_6W7", + "outputId": "2f2ba046-082f-422c-a391-3d6991276830" + }, + "outputs": [], + "source": [ + "!pip uninstall numpy -y -q\n", + "!pip install numpy==1.24.3 onnxruntime-gpu gradio progressbar33 insightface ffmpeg_python opencv_python -q --force\n", + "\n", + "!git clone https://github.com/xaviviro/refacer.git\n", + "%cd refacer\n", + "\n", + "!wget --content-disposition \"https://huggingface.co/deepinsight/inswapper/resolve/main/inswapper_128.onnx\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "0SsyI3quBb0L", + "outputId": "56add1a6-6b47-429d-e07a-cf3fadc7a6ce" + }, + "outputs": [], + "source": [ + "!python app.py" + ] + } + ], + "metadata": { + "accelerator": "GPU", + "colab": { + "machine_shape": "hm", + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +}