Skip to content

MFaresJA/fastapiTasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌸 FastAPI + Streamlit Iris Predictor (Week 2)

This project demonstrates how to serve a trained Iris species classifier with a FastAPI backend and an interactive Streamlit UI, all containerized with Docker & Docker Compose.


🚀 Run locally

uvicorn main:app --reload

Open API Docs: http://127.0.0.1:8000/docs


🐳 Run with Docker

docker build -t myfastapi:dev .
docker run --rm -p 8000:8000 myfastapi:dev

🐙 Run with Docker Compose

docker compose up --build
docker compose down

To run in background (detached mode):

docker compose up --build -d

Services


📸 Screenshots

🌐 Streamlit UI

Streamlit Iris Predictor

✅ Health Check Endpoint

Health Check

📖 Swagger API Docs

Swagger API

🔍 Predictions

Versicolor Versicolor Prediction

Virginica Virginica Prediction

Setosa Setosa Prediction


🏋️ Training the Model (first run only)

docker compose exec api python IrisWorking/train_iris.py

📦 Tech Stack

  • FastAPI → API backend
  • Streamlit → Frontend UI
  • scikit-learn → Machine Learning model
  • Docker + Docker Compose → Containerization & orchestration

✨ With this setup, you can interact with the Iris ML model via Swagger Docs or use the Streamlit web UI to visualize predictions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors