Sign inSign up

utkarshg1/fastapi-iris

By utkarshg1

•Updated about 2 years ago

Machine Learning Application Iris Species prediction web application with FastAPI and Uvicorn

Image
Machine learning & AI
Data science
Web servers
1

942

utkarshg1/fastapi-iris repository overview

⁠Iris Species Prediction App with FastAPI and Scikit-Learn

⁠Overview

This Docker image hosts an Iris Species Prediction web application built with FastAPI and Scikit-Learn. The app allows users to input sepal and petal measurements of iris flowers and returns a prediction of the iris species, along with the associated probabilities for each species. The model is trained using the classic Iris dataset.

Github Link - https://github.com/utkarshg1/FastAPI-ML⁠

Demo Link - https://iris-fastapi-meer.onrender.com/⁠

⁠Features
  • Web UI: A user-friendly interface built with Jinja2 templates to input iris flower measurements.
  • Prediction API: Utilizes a pre-trained Scikit-Learn model to predict the species of iris flowers based on user input.
  • Real-Time Inference: Provides the prediction probabilities for each of the three iris species (setosa, versicolor, and virginica).
  • FastAPI: An efficient, high-performance, asynchronous web framework for serving the app.
  • Dockerized: Fully containerized for easy deployment and scaling.
⁠Technologies Used
  • FastAPI: For building the web application and RESTful API.
  • Scikit-Learn: For machine learning model training and prediction.
  • Jinja2: For HTML templating.
  • Docker: For containerizing the application, ensuring portability and consistency across different environments.
⁠How to Use
  1. Pull the Image:

    docker pull utkarshg1/fastapi-iris
    
  2. Run the Container:

    docker run -d -p 8000:8000 utkarshg1/fastapi-iris:latest
    
  3. Access the Application:
    Open your web browser and go to http://localhost:8000 to start making predictions.

⁠Endpoints
  • GET /: Displays the iris prediction form.
  • POST /predict: Submits the form data and returns the predicted species along with probabilities.
⁠Environment Variables
  • UVICORN_HOST: Set the host for the Uvicorn server (default: 0.0.0.0).
  • UVICORN_PORT: Set the port for the Uvicorn server (default: 8000).
⁠Example Usage
  1. Input sepal length, sepal width, petal length, and petal width in the form.
  2. Click "Predict" to get the predicted species and its associated probabilities.
⁠License

This project is licensed under the Apache License 2.0

⁠Contributing

Feel free to submit issues or pull requests to improve the app.

Tag summary

Content type

Image

Digest

sha256:10c8393b5…

Size

136.6 MB

Last updated

about 2 years ago

docker pull utkarshg1/fastapi-iris