Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
---
|
| 2 |
title: Face Swap App
|
| 3 |
emoji: 🤖
|
| 4 |
colorFrom: purple
|
|
@@ -7,105 +6,3 @@ sdk: docker
|
|
| 7 |
sdk_version: 6.1.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
-
---
|
| 11 |
-
|
| 12 |
-
# Face Swapping App by Adil Khan
|
| 13 |
-
|
| 14 |
-
Welcome to the **Face Swapping App** repository! This application leverages **Streamlit** and **OpenCV**, powered by **InsightFace**, to perform seamless face swapping on images and videos. Whether you want to swap faces in pictures or videos, this app provides a simple and efficient solution.
|
| 15 |
-
|
| 16 |
-
---
|
| 17 |
-
|
| 18 |
-
## Features
|
| 19 |
-
|
| 20 |
-
- **Image Face Swap**: Effortlessly swap faces between a source and target image.
|
| 21 |
-
- **Video Face Swap**: Apply face swapping across all frames of a target video using a source face image.
|
| 22 |
-
- **High Precision**: Built on **InsightFace** deep learning models for accurate face detection and swapping.
|
| 23 |
-
- **User-Friendly Interface**: Interact with the app through a sleek and intuitive **Streamlit** interface.
|
| 24 |
-
|
| 25 |
-
---
|
| 26 |
-
|
| 27 |
-
## How It Works
|
| 28 |
-
|
| 29 |
-
1. **Image Face Swapping**:
|
| 30 |
-
- Detects faces in both the source and target images.
|
| 31 |
-
- Replaces the target face with the source face using the `inswapper_128.onnx` model.
|
| 32 |
-
|
| 33 |
-
2. **Video Face Swapping**:
|
| 34 |
-
- Processes each frame of the video to detect and swap faces to match the source face.
|
| 35 |
-
|
| 36 |
-
---
|
| 37 |
-
|
| 38 |
-
## Installation
|
| 39 |
-
|
| 40 |
-
Follow these steps to get started:
|
| 41 |
-
|
| 42 |
-
1. **Clone the repository**:
|
| 43 |
-
```bash
|
| 44 |
-
git clone https://github.com/AdiKhanOfficial/face-swap-app.git
|
| 45 |
-
cd face-swap-app
|
| 46 |
-
```
|
| 47 |
-
|
| 48 |
-
2. **Install dependencies**:
|
| 49 |
-
```bash
|
| 50 |
-
pip install -r requirements.txt
|
| 51 |
-
```
|
| 52 |
-
|
| 53 |
-
3. **Run the app**:
|
| 54 |
-
- For the Streamlit interface:
|
| 55 |
-
```bash
|
| 56 |
-
streamlit run app.py
|
| 57 |
-
```
|
| 58 |
-
- Or, simply run:
|
| 59 |
-
```bash
|
| 60 |
-
python run.py
|
| 61 |
-
```
|
| 62 |
-
|
| 63 |
-
---
|
| 64 |
-
|
| 65 |
-
## Requirements
|
| 66 |
-
|
| 67 |
-
- **Python 3.9**
|
| 68 |
-
- **Streamlit**
|
| 69 |
-
- **OpenCV**
|
| 70 |
-
- **InsightFace**
|
| 71 |
-
|
| 72 |
-
**Download Links**:
|
| 73 |
-
- [Python 3.9](https://www.python.org/downloads/release/python-390/)
|
| 74 |
-
- [InSwapper Model (`inswapper_128.onnx`)](https://cdn.adikhanofficial.com/python/insightface/models/inswapper_128.onnx)
|
| 75 |
-
|
| 76 |
-
---
|
| 77 |
-
|
| 78 |
-
## Usage
|
| 79 |
-
|
| 80 |
-
1. Open the application using Streamlit or `run.py`.
|
| 81 |
-
2. Upload your **source face image** and the **target image/video**.
|
| 82 |
-
3. Click the process button and let the magic happen!
|
| 83 |
-
4. Once processing is complete, download the swapped images or videos directly from the app.
|
| 84 |
-
|
| 85 |
-
---
|
| 86 |
-
|
| 87 |
-
## Results
|
| 88 |
-
<img src='https://raw.githubusercontent.com/AdiKhanOfficial/face_swapping/refs/heads/main/Results/Result.jpg' style='width:100%'/>
|
| 89 |
-
|
| 90 |
-
---
|
| 91 |
-
|
| 92 |
-
## Contributing
|
| 93 |
-
|
| 94 |
-
Contributions are welcome! If you’d like to improve the app or add new features, feel free to fork the repository, make your changes, and submit a pull request.
|
| 95 |
-
|
| 96 |
-
---
|
| 97 |
-
|
| 98 |
-
## License
|
| 99 |
-
|
| 100 |
-
This project is licensed under the [MIT License](LICENSE).
|
| 101 |
-
|
| 102 |
-
---
|
| 103 |
-
|
| 104 |
-
## About
|
| 105 |
-
|
| 106 |
-
Developed by **Adil Khan**.
|
| 107 |
-
For more projects and updates, visit my [GitHub Profile](https://github.com/AdiKhanOfficial) or follow me on social media.
|
| 108 |
-
|
| 109 |
-
---
|
| 110 |
-
|
| 111 |
-
Feel free to reach out with any questions or feedback! 😊
|
|
|
|
|
|
|
| 1 |
title: Face Swap App
|
| 2 |
emoji: 🤖
|
| 3 |
colorFrom: purple
|
|
|
|
| 6 |
sdk_version: 6.1.0
|
| 7 |
app_file: app.py
|
| 8 |
pinned: false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|