Spaces:
Runtime error
Runtime error
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,145 +1,144 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: FaceAging AI
|
| 3 |
-
emoji: π΄
|
| 4 |
-
colorFrom: gray
|
| 5 |
-
colorTo: indigo
|
| 6 |
-
sdk:
|
| 7 |
-
sdk_version:
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
---
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
# FaceAging AI β Realistic Face Aging and De-Aging with AI
|
| 14 |
-
|
| 15 |
-
**FaceAging AI** is an advanced AI-powered web application that transforms face images to appear older or younger with realistic results. It leverages deep learning models for face detection and age transformation, offering an intuitive interface for users to upload images and see instant aged or de-aged outputs.
|
| 16 |
-
|
| 17 |
-
---
|
| 18 |
-
|
| 19 |
-
## Features
|
| 20 |
-
|
| 21 |
-
* **Face Aging & De-Aging**: Convert young faces to old and vice versa with high visual fidelity.
|
| 22 |
-
* **Automatic Face Detection**: Detects faces in uploaded images using OpenCV to process only valid faces.
|
| 23 |
-
* **Base64 Image Encoding**: Returns transformed images efficiently encoded for seamless frontend display.
|
| 24 |
-
* **FastAPI Backend**: Robust and scalable backend API handling image processing and AI inference.
|
| 25 |
-
* **Simple, Responsive UI**: User-friendly frontend using HTML, CSS, JavaScript, and Jinja2 templates.
|
| 26 |
-
* **CORS Enabled**: Allows cross-origin requests for flexible frontend-backend integration.
|
| 27 |
-
|
| 28 |
-
---
|
| 29 |
-
|
| 30 |
-
## Tech Stack
|
| 31 |
-
|
| 32 |
-
* **Backend**: FastAPI (Python)
|
| 33 |
-
* **Frontend**: HTML, CSS, JavaScript, Jinja2 Templates
|
| 34 |
-
* **AI & Image Processing**: OpenCV, Pillow, NumPy, Custom Face Aging Models
|
| 35 |
-
* **Deployment**: Cloud-ready (Render, Heroku, or any ASGI-compatible platform)
|
| 36 |
-
|
| 37 |
-
---
|
| 38 |
-
|
| 39 |
-
## Project Structure
|
| 40 |
-
|
| 41 |
-
```
|
| 42 |
-
faceaging-ai/
|
| 43 |
-
βββ main.py # FastAPI app entry point with endpoints
|
| 44 |
-
βββ helper.py # AI face aging helper functions & models
|
| 45 |
-
βββ static/ # Static files (CSS, JS, images)
|
| 46 |
-
βββ templates/ # HTML templates (Jinja2)
|
| 47 |
-
βββ requirements.txt # Python dependencies
|
| 48 |
-
βββ README.md # Project documentation (this file)
|
| 49 |
-
βββ Procfile # For deployment (if using Heroku/Render)
|
| 50 |
-
```
|
| 51 |
-
|
| 52 |
-
---
|
| 53 |
-
|
| 54 |
-
## Setup and Installation
|
| 55 |
-
|
| 56 |
-
### Prerequisites
|
| 57 |
-
|
| 58 |
-
* Python 3.8+
|
| 59 |
-
* Virtual environment tool (venv or conda)
|
| 60 |
-
* FastAPI, Uvicorn, OpenCV, Pillow, NumPy (see requirements.txt)
|
| 61 |
-
|
| 62 |
-
### Steps
|
| 63 |
-
|
| 64 |
-
1. **Clone the repository**
|
| 65 |
-
|
| 66 |
-
```bash
|
| 67 |
-
git clone https://github.com/parthmax2/faceaging-ai.git
|
| 68 |
-
cd faceaging-ai
|
| 69 |
-
```
|
| 70 |
-
|
| 71 |
-
2. **Create and activate a virtual environment**
|
| 72 |
-
|
| 73 |
-
```bash
|
| 74 |
-
python -m venv venv
|
| 75 |
-
source venv/bin/activate # Windows: venv\Scripts\activate
|
| 76 |
-
```
|
| 77 |
-
|
| 78 |
-
3. **Install dependencies**
|
| 79 |
-
|
| 80 |
-
```bash
|
| 81 |
-
pip install -r requirements.txt
|
| 82 |
-
```
|
| 83 |
-
|
| 84 |
-
4. **Run the FastAPI development server**
|
| 85 |
-
|
| 86 |
-
```bash
|
| 87 |
-
uvicorn main:app --reload
|
| 88 |
-
```
|
| 89 |
-
|
| 90 |
-
5. **Access the app**
|
| 91 |
-
|
| 92 |
-
Open your browser and navigate to:
|
| 93 |
-
|
| 94 |
-
```
|
| 95 |
-
http://127.0.0.1:8000
|
| 96 |
-
```
|
| 97 |
-
|
| 98 |
-
Upload a face image, select the conversion type (Young to Old or Old to Young), and click Generate to see the transformed image.
|
| 99 |
-
|
| 100 |
-
---
|
| 101 |
-
|
| 102 |
-
## API Endpoints
|
| 103 |
-
|
| 104 |
-
* `GET /` β Serves the main web interface.
|
| 105 |
-
* `POST /convert/` β Accepts an image file and conversion type, returns the aged or de-aged image as a base64 string.
|
| 106 |
-
|
| 107 |
-
---
|
| 108 |
-
|
| 109 |
-
## Deployment
|
| 110 |
-
|
| 111 |
-
You can deploy this FastAPI app on any ASGI-compatible platform:
|
| 112 |
-
|
| 113 |
-
* **Render:** Easy cloud deployment with automatic Dockerfile or Python environment detection.
|
| 114 |
-
* **Heroku:** Use the provided `Procfile` and `requirements.txt`.
|
| 115 |
-
* **Other platforms:** Ensure support for Python 3.8+, ASGI, and WebSocket if needed.
|
| 116 |
-
|
| 117 |
-
---
|
| 118 |
-
|
| 119 |
-
## Contribution
|
| 120 |
-
|
| 121 |
-
Contributions are welcome! Please open issues or submit pull requests for:
|
| 122 |
-
|
| 123 |
-
* Improving model accuracy
|
| 124 |
-
* Enhancing UI/UX
|
| 125 |
-
* Adding new features or endpoints
|
| 126 |
-
* Optimizing performance
|
| 127 |
-
|
| 128 |
-
---
|
| 129 |
-
|
| 130 |
-
## License
|
| 131 |
-
|
| 132 |
-
MIT License β free to use, modify, and distribute.
|
| 133 |
-
|
| 134 |
-
---
|
| 135 |
-
|
| 136 |
-
## Contact
|
| 137 |
-
|
| 138 |
-
**Saksham Pathak**
|
| 139 |
-
Masterβs in Artificial Intelligence & Machine Learning, IIIT Lucknow
|
| 140 |
-
[GitHub](https://github.com/parthmax2) | [LinkedIn](https://linkedin.com/in/sakshampathak) | [Instagram](https://instagram.com/parthmax_)
|
| 141 |
-
|
| 142 |
-
---
|
| 143 |
-
|
| 144 |
-
*FaceAging AI Β© Saksham Pathak. Powered by open-source AI and computer vision technologies.*
|
| 145 |
-
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: FaceAging AI
|
| 3 |
+
emoji: π΄
|
| 4 |
+
colorFrom: gray
|
| 5 |
+
colorTo: indigo
|
| 6 |
+
sdk: docker
|
| 7 |
+
sdk_version: 5.30.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
# FaceAging AI β Realistic Face Aging and De-Aging with AI
|
| 14 |
+
|
| 15 |
+
**FaceAging AI** is an advanced AI-powered web application that transforms face images to appear older or younger with realistic results. It leverages deep learning models for face detection and age transformation, offering an intuitive interface for users to upload images and see instant aged or de-aged outputs.
|
| 16 |
+
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
## Features
|
| 20 |
+
|
| 21 |
+
* **Face Aging & De-Aging**: Convert young faces to old and vice versa with high visual fidelity.
|
| 22 |
+
* **Automatic Face Detection**: Detects faces in uploaded images using OpenCV to process only valid faces.
|
| 23 |
+
* **Base64 Image Encoding**: Returns transformed images efficiently encoded for seamless frontend display.
|
| 24 |
+
* **FastAPI Backend**: Robust and scalable backend API handling image processing and AI inference.
|
| 25 |
+
* **Simple, Responsive UI**: User-friendly frontend using HTML, CSS, JavaScript, and Jinja2 templates.
|
| 26 |
+
* **CORS Enabled**: Allows cross-origin requests for flexible frontend-backend integration.
|
| 27 |
+
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## Tech Stack
|
| 31 |
+
|
| 32 |
+
* **Backend**: FastAPI (Python)
|
| 33 |
+
* **Frontend**: HTML, CSS, JavaScript, Jinja2 Templates
|
| 34 |
+
* **AI & Image Processing**: OpenCV, Pillow, NumPy, Custom Face Aging Models
|
| 35 |
+
* **Deployment**: Cloud-ready (Render, Heroku, or any ASGI-compatible platform)
|
| 36 |
+
|
| 37 |
+
---
|
| 38 |
+
|
| 39 |
+
## Project Structure
|
| 40 |
+
|
| 41 |
+
```
|
| 42 |
+
faceaging-ai/
|
| 43 |
+
βββ main.py # FastAPI app entry point with endpoints
|
| 44 |
+
βββ helper.py # AI face aging helper functions & models
|
| 45 |
+
βββ static/ # Static files (CSS, JS, images)
|
| 46 |
+
βββ templates/ # HTML templates (Jinja2)
|
| 47 |
+
βββ requirements.txt # Python dependencies
|
| 48 |
+
βββ README.md # Project documentation (this file)
|
| 49 |
+
βββ Procfile # For deployment (if using Heroku/Render)
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
---
|
| 53 |
+
|
| 54 |
+
## Setup and Installation
|
| 55 |
+
|
| 56 |
+
### Prerequisites
|
| 57 |
+
|
| 58 |
+
* Python 3.8+
|
| 59 |
+
* Virtual environment tool (venv or conda)
|
| 60 |
+
* FastAPI, Uvicorn, OpenCV, Pillow, NumPy (see requirements.txt)
|
| 61 |
+
|
| 62 |
+
### Steps
|
| 63 |
+
|
| 64 |
+
1. **Clone the repository**
|
| 65 |
+
|
| 66 |
+
```bash
|
| 67 |
+
git clone https://github.com/parthmax2/faceaging-ai.git
|
| 68 |
+
cd faceaging-ai
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
2. **Create and activate a virtual environment**
|
| 72 |
+
|
| 73 |
+
```bash
|
| 74 |
+
python -m venv venv
|
| 75 |
+
source venv/bin/activate # Windows: venv\Scripts\activate
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
3. **Install dependencies**
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
pip install -r requirements.txt
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
4. **Run the FastAPI development server**
|
| 85 |
+
|
| 86 |
+
```bash
|
| 87 |
+
uvicorn main:app --reload
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
5. **Access the app**
|
| 91 |
+
|
| 92 |
+
Open your browser and navigate to:
|
| 93 |
+
|
| 94 |
+
```
|
| 95 |
+
http://127.0.0.1:8000
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
Upload a face image, select the conversion type (Young to Old or Old to Young), and click Generate to see the transformed image.
|
| 99 |
+
|
| 100 |
+
---
|
| 101 |
+
|
| 102 |
+
## API Endpoints
|
| 103 |
+
|
| 104 |
+
* `GET /` β Serves the main web interface.
|
| 105 |
+
* `POST /convert/` β Accepts an image file and conversion type, returns the aged or de-aged image as a base64 string.
|
| 106 |
+
|
| 107 |
+
---
|
| 108 |
+
|
| 109 |
+
## Deployment
|
| 110 |
+
|
| 111 |
+
You can deploy this FastAPI app on any ASGI-compatible platform:
|
| 112 |
+
|
| 113 |
+
* **Render:** Easy cloud deployment with automatic Dockerfile or Python environment detection.
|
| 114 |
+
* **Heroku:** Use the provided `Procfile` and `requirements.txt`.
|
| 115 |
+
* **Other platforms:** Ensure support for Python 3.8+, ASGI, and WebSocket if needed.
|
| 116 |
+
|
| 117 |
+
---
|
| 118 |
+
|
| 119 |
+
## Contribution
|
| 120 |
+
|
| 121 |
+
Contributions are welcome! Please open issues or submit pull requests for:
|
| 122 |
+
|
| 123 |
+
* Improving model accuracy
|
| 124 |
+
* Enhancing UI/UX
|
| 125 |
+
* Adding new features or endpoints
|
| 126 |
+
* Optimizing performance
|
| 127 |
+
|
| 128 |
+
---
|
| 129 |
+
|
| 130 |
+
## License
|
| 131 |
+
|
| 132 |
+
MIT License β free to use, modify, and distribute.
|
| 133 |
+
|
| 134 |
+
---
|
| 135 |
+
|
| 136 |
+
## Contact
|
| 137 |
+
|
| 138 |
+
**Saksham Pathak**
|
| 139 |
+
Masterβs in Artificial Intelligence & Machine Learning, IIIT Lucknow
|
| 140 |
+
[GitHub](https://github.com/parthmax2) | [LinkedIn](https://linkedin.com/in/sakshampathak) | [Instagram](https://instagram.com/parthmax_)
|
| 141 |
+
|
| 142 |
+
---
|
| 143 |
+
|
| 144 |
+
*FaceAging AI Β© Saksham Pathak. Powered by open-source AI and computer vision technologies.*
|
|
|