This project is a FastAPI application that predicts age and gender from uploaded images. It utilizes OpenCV for face detection and neural networks for age and gender predictions.
- Docker
-
Clone the repository:
git clone Age-Gender-Detection cd Age-Gender-Detection
-
Build the Docker image:
docker build -t fastapi_app .
-
Run the container:
docker run -p 8000:8000 fastapi_app
-
After executing the above command, your FastAPI application should be running on
http://127.0.0.1:8000
.
-
Send a
POST
request tohttp://127.0.0.1:8000/predict/
with an image file attached. The API will return the predicted age and gender.Example Response:
[ {"gender": "Male", "age": "(25-32)"}, {"gender": "Female", "age": "(15-20)"} ]
- FastAPI: Web framework to build APIs.
- OpenCV: Used for face detection.
- Docker: Used for containerization.
Feel free to submit pull requests or open issues to improve this project.