Spaces:
Configuration error
Configuration error
Bassam Mejlaoui
commited on
Commit
•
f74c877
1
Parent(s):
bd18d3b
Update README.md
Browse files
README.md
CHANGED
@@ -1,13 +1,165 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Awesome Deep Fake
|
2 |
+
|
3 |
+
*Explore deepfake tech powered by AI. Craft unique content responsibly using free AI tools.*
|
4 |
+
|
5 |
+
This repository contains a deep fake project aimed at generating realistic face-swapped videos. The project leverages deep learning models and GPU acceleration to perform face swapping efficiently.
|
6 |
+
|
7 |
+
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1aMqLwtn_jpTObkNlHJg0kS5FFFTuZafG?usp=sharing)
|
8 |
+
|
9 |
+
![image](https://github.com/mejbass/Awesome-Deep-Fake-/assets/130122304/4a2d0739-22e8-4502-b316-d36f9a77b81e)
|
10 |
+
|
11 |
+
|
12 |
+
**Tips for Responsible Deepfake Creation**
|
13 |
+
|
14 |
+
- **Consent is Key:** Always obtain explicit consent from individuals whose likenesses you wish to use.
|
15 |
+
- **Integrity Matters:** Ensure that the content you create is never harmful or defamatory.
|
16 |
+
- **Purposeful Creation:** Strive to make content that is fun or serves a productive purpose.
|
17 |
+
- **Reflect Before You Act:** Before publishing or sharing a deepfake video, consider its impact.
|
18 |
+
|
19 |
+
This project is a profound opportunity to engage with AI in a way that can illuminate its potential for good. Let's set an example for the responsible use of AI and build a community that prioritizes ethical considerations in all our technological endeavors.
|
20 |
+
|
21 |
+
We trust in your judgment and creativity.
|
22 |
+
|
23 |
+
***Remember:***
|
24 |
+
|
25 |
+
- **Consent is Key**
|
26 |
+
- **Integrity Matters**
|
27 |
+
- **Purposeful Creation**
|
28 |
+
- **Reflect Before You Act**
|
29 |
+
## Installation
|
30 |
+
|
31 |
+
To set up the project, follow these steps:
|
32 |
+
|
33 |
+
1. **Check for GPU Availability:**
|
34 |
+
```python
|
35 |
+
from IPython.display import clear_output
|
36 |
+
import codecs
|
37 |
+
import torch
|
38 |
+
|
39 |
+
if torch.cuda.is_available():
|
40 |
+
device="cuda"
|
41 |
+
!apt-get install nvidia-cuda-toolkit
|
42 |
+
print("Using GPU")
|
43 |
+
else:
|
44 |
+
device="cpu"
|
45 |
+
print("Using CPU")
|
46 |
+
```
|
47 |
+
|
48 |
+
2. **Clone the Repository:**
|
49 |
+
```python
|
50 |
+
giturl = codecs.decode('uggcf://tvguho.pbz/Mnpulfnhef/snprshfvba.tvg','rot_13')
|
51 |
+
gitdir = codecs.decode('snprshfvba','rot_13')
|
52 |
+
!git clone {giturl}
|
53 |
+
%cd /content/{gitdir}
|
54 |
+
!python install.py --onnxruntime cuda-11.8 --skip-conda
|
55 |
+
|
56 |
+
clear_output()
|
57 |
+
print("Installed!")
|
58 |
+
```
|
59 |
+
|
60 |
+
## Running the Project
|
61 |
+
|
62 |
+
### Local Gradio Interface
|
63 |
+
|
64 |
+
To run the project with a local Gradio interface:
|
65 |
+
|
66 |
+
1. **Navigate to the Project Directory:**
|
67 |
+
```python
|
68 |
+
import codecs
|
69 |
+
gitdir = codecs.decode('snprshfvba','rot_13')
|
70 |
+
%cd /content/{gitdir}
|
71 |
+
```
|
72 |
+
|
73 |
+
2. **Run the Application:**
|
74 |
+
```python
|
75 |
+
if device=="cuda":
|
76 |
+
!python run.py --execution-providers cpu cuda
|
77 |
+
else:
|
78 |
+
!python run.py --execution-providers cpu
|
79 |
+
```
|
80 |
+
|
81 |
+
### Local Tunnel
|
82 |
+
|
83 |
+
To run the project with a local tunnel for remote access:
|
84 |
+
|
85 |
+
1. **Install LocalTunnel:**
|
86 |
+
```python
|
87 |
+
!npm install -g localtunnel
|
88 |
+
```
|
89 |
+
|
90 |
+
2. **Set Up Local Tunnel:**
|
91 |
+
```python
|
92 |
+
import subprocess
|
93 |
+
import threading
|
94 |
+
import time
|
95 |
+
import socket
|
96 |
+
import urllib.request
|
97 |
+
|
98 |
+
def iframe_thread(port):
|
99 |
+
while True:
|
100 |
+
time.sleep(0.5)
|
101 |
+
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
102 |
+
result = sock.connect_ex(('127.0.0.1', port))
|
103 |
+
if result == 0:
|
104 |
+
break
|
105 |
+
sock.close()
|
106 |
+
|
107 |
+
from colorama import Fore, Style
|
108 |
+
print(Fore.GREEN + "\nIP: ", Fore.RED, urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip("\n"), "\n", Style.RESET_ALL)
|
109 |
+
p = subprocess.Popen(["lt", "--port", "{}".format(port)], stdout=subprocess.PIPE)
|
110 |
+
for line in p.stdout:
|
111 |
+
print(line.decode(), end='')
|
112 |
+
|
113 |
+
threading.Thread(target=iframe_thread, daemon=True, args=(7860,)).start()
|
114 |
+
```
|
115 |
+
|
116 |
+
3. **Run the Application:**
|
117 |
+
```python
|
118 |
+
!python run.py
|
119 |
+
```
|
120 |
+
|
121 |
+
## Through Google Colab
|
122 |
+
|
123 |
+
You can access the Refacer through Google Colab by following this link: [refacer_colab.ipynb](https://colab.research.google.com/drive/1aMqLwtn_jpTObkNlHJg0kS5FFFTuZafG?usp=sharing)
|
124 |
+
|
125 |
+
|
126 |
+
## Upload the required files
|
127 |
+
|
128 |
+
Upload the respective files to their designated sections and click “Start” (The big Red button at the bottom of the page). This action initiates a process that will “reface” all frames in the video using the provided faces. Please note that this process may take some time.
|
129 |
+
|
130 |
+
![image](https://github.com/mejbass/Awesome-Deep-Fake-/assets/130122304/491c3be4-a2b5-467b-9ba4-0abe82e3c07b)
|
131 |
+
|
132 |
+
## Done!
|
133 |
+
|
134 |
+
Congratulations, you have successfully created your first deepfake video.
|
135 |
+
|
136 |
+
Remember:
|
137 |
+
|
138 |
+
- **Consent is Key**
|
139 |
+
- **Integrity Matters**
|
140 |
+
- **Purposeful Creation**
|
141 |
+
- **Reflect Before You Act**
|
142 |
+
|
143 |
+
## Refacer Not Working?
|
144 |
+
|
145 |
+
If you have difficulty with Refacer, try out these alternative tools.
|
146 |
+
|
147 |
+
- [Magic Hour: Generative AI Tools for Video Content Creation](https://magichour.ai)
|
148 |
+
- [AI Face Swap Online Free: Photo, Video, GIF Face Swap](https://www.vidnoz.com/face-swap.html)
|
149 |
+
- [Free AI Face Swap Online for Videos & Photos | MioCreate](https://www.miocreate.com/face-swap.html)
|
150 |
+
|
151 |
+
Questions? Feedback? Requests? Discord: Samej2023
|
152 |
+
|
153 |
+
## Disclaimer for Refacer
|
154 |
+
|
155 |
+
> :warning: This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
|
156 |
+
|
157 |
+
> :warning: This software is intended for educational and research purposes only. It is not intended for use in any malicious activities. The author of this software does not condone or support the use of this software for any harmful actions, including but not limited to identity theft, invasion of privacy, or defamation. Any use of this software for such purposes is strictly prohibited.
|
158 |
+
|
159 |
+
> :warning: You may only use this software with images for which you have the right to use and the necessary permissions. Any use of images without the proper rights and permissions is strictly prohibited.
|
160 |
+
|
161 |
+
> :warning: The author of this software is not responsible for any misuse of the software or for any violation of rights and privacy resulting from such misuse.
|
162 |
+
|
163 |
+
> :warning: To prevent misuse, the software contains an integrated protective mechanism that prevents it from working with illegal or similar types of media.
|
164 |
+
|
165 |
+
> :warning: By using this software, you agree to abide by all applicable laws, to respect the rights and privacy of others, and to use the software responsibly and ethically.
|