Upload 2 files
Browse files
README.md
CHANGED
|
@@ -1,14 +1,59 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DeepFake Detection Model
|
| 2 |
+
|
| 3 |
+
This repository hosts a **DeepFake Detection Model** deployed using **Streamlit** on Hugging Face Spaces. The model is trained to classify images as **REAL or FAKE** using Convolutional Neural Networks (CNNs).
|
| 4 |
+
|
| 5 |
+
## π Live Demo
|
| 6 |
+
Check out the deployed model: [DeepFake Detector on Hugging Face](https://huggingface.co/spaces/your-username/deepfake-detection)
|
| 7 |
+
|
| 8 |
+
## π Features
|
| 9 |
+
- **Deep Learning-Based Detection**: Uses a pre-trained CNN model to detect DeepFake images.
|
| 10 |
+
- **User-Friendly UI**: Built with Streamlit for a simple and interactive experience.
|
| 11 |
+
- **Easy API Integration**: Allows users to upload images and get predictions.
|
| 12 |
+
|
| 13 |
+
## π Installation & Setup
|
| 14 |
+
To run the project locally, follow these steps:
|
| 15 |
+
|
| 16 |
+
### 1οΈβ£ Clone the Repository
|
| 17 |
+
git clone https://huggingface.co/spaces/your-username/deepfake-detection
|
| 18 |
+
cd deepfake-detection
|
| 19 |
+
|
| 20 |
+
### 2οΈβ£ Install Dependencies
|
| 21 |
+
Ensure you have **Python 3.8+** installed. Install dependencies using:
|
| 22 |
+
pip install -r requirements.txt
|
| 23 |
+
|
| 24 |
+
### 3οΈβ£ Run the Application
|
| 25 |
+
streamlit run app.py
|
| 26 |
+
|
| 27 |
+
## π Project Structure
|
| 28 |
+
```
|
| 29 |
+
π deepfake-detection
|
| 30 |
+
βββ π app.py # Main Streamlit app
|
| 31 |
+
βββ π requirements.txt # Dependencies
|
| 32 |
+
βββ π README.md # Documentation
|
| 33 |
+
βββ π deep-fake-detection-on-image-fyp.ipynb
|
| 34 |
+
|
| 35 |
+
## π§ Model Details
|
| 36 |
+
- **Model Used**: Xception-based CNN
|
| 37 |
+
- **Input Shape**: (256, 256, 3)
|
| 38 |
+
- **Output**: Binary classification (REAL or FAKE)
|
| 39 |
+
|
| 40 |
+
## πΌοΈ How to Use
|
| 41 |
+
1. Upload an image of a face.
|
| 42 |
+
2. The model will process the image and classify it as **REAL** or **FAKE**.
|
| 43 |
+
3. The result will be displayed on the screen.
|
| 44 |
+
|
| 45 |
+
## π Deploying on Hugging Face
|
| 46 |
+
If you want to deploy your own version:
|
| 47 |
+
1. Create a new Space on Hugging Face.
|
| 48 |
+
2. Upload `app.py`, `requirements.txt`, and your model file.
|
| 49 |
+
3. Set the Space **Runtime** to `Streamlit`.
|
| 50 |
+
4. Click **Restart** to launch the app.
|
| 51 |
+
|
| 52 |
+
## π€ Contributing
|
| 53 |
+
Feel free to fork this repository and improve the model! Pull requests are welcome. π
|
| 54 |
+
|
| 55 |
+
## π License
|
| 56 |
+
This project is licensed under the MIT License.
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
Developed by **Muneeb Nadeem** | Contact: [muneebnadeem1870@gmail.com]
|
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import numpy as np
|
| 3 |
-
from tensorflow.keras.models import load_model
|
| 4 |
-
from PIL import Image
|
| 5 |
|
| 6 |
# Model Load
|
| 7 |
model = load_model("xception_deepfake_image.h5")
|
|
|
|
| 1 |
+
import streamlit as st # type: ignore
|
| 2 |
+
import numpy as np # type: ignore
|
| 3 |
+
from tensorflow.keras.models import load_model # type: ignore
|
| 4 |
+
from PIL import Image # type: ignore
|
| 5 |
|
| 6 |
# Model Load
|
| 7 |
model = load_model("xception_deepfake_image.h5")
|