This repository contains a Python-based project with several components including an application script, upload functionality, and machine learning model.
app.py: Main application script.upload.py: Script for handling file uploads.fairface.pt: Pre-trained model file.prediction.json: JSON file for storing predictions.requirements.txt: Python dependencies.Dockerfile: Docker configuration for containerizing the application..dockerignoreand.gitignore: Ignore files for Docker and Git.
-
Create a virtual environment and activate it:
python -m venv .venv .\.venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the main application:
python app.py
-
Use
upload.pyto handle file uploads.
Build and run the Docker container:
docker build -t new-test-app .
docker run -p 8000:8000 new-test-app- The project uses a pre-trained model
fairface.ptfor predictions. prediction.jsonstores the output predictions.
This project is a Python-based facial analysis application that leverages a pre-trained machine learning model to analyze images. The main functionalities include:
- Handling image uploads through the
upload.pyscript. - Processing uploaded images using the pre-trained model
fairface.ptto predict facial attributes such as age, gender, and ethnicity. - Storing the prediction results in
prediction.jsonfor further use or display. - The main application logic is contained in
app.py, which coordinates the workflow and serves as the entry point. - The project supports containerization via Docker for easy deployment.
This setup allows users to upload images, have them analyzed automatically, and retrieve the results efficiently.