There are many ways to make web interfaces to allow interaction with Machine Learning models and we will cover two of them.
Now that you know how to build some Machine Learning models, it is the time to discover how to embeded it into a web app with a user-friendly interface. You have already saw, of course, some ML tools and you maybe played with it. If so, you know that it is much more interesting to interact with a ML model through a beautiful interface than using a notebook, especially when you are not an expert of this domain.
In this project, we aim to help you to discover how to embed a ML model into a web app to interact with it much easier, by inputing the required information, making predictions and showing the result.
You will have a minimal interface demo with Gradio & Streamlit, this will just serve you to make sure that everything works correctly. Then, you will have to make your own interfaces, those allowing you to interact with a Machine Learning model, that is to say:
- Pass values through the interface;
- Recover these values in backend;
- Apply the necessary processing;
- Submit the previously processed values to the ML model to make the predictions;
- Process the predictions obtained and display them on the interface.
You have two ways in order to setup and run this project.
You need Python3
on your system to setup this app. Then you can clone this repo and being at the repo's root :: gradio-iris-app> ...
follow the steps below:
-
Windows:
python -m venv venv; venv\Scripts\activate; python -m pip install -q --upgrade pip; python -m pip install -qr requirements.txt
-
Linux & MacOs:
python3 -m venv venv; source venv/bin/activate; python -m pip install -q --upgrade pip; python -m pip install -qr requirements.txt
NB: For MacOs users, please install Xcode
if you have an issue.
-
Run the demo apps (being at the repository root):
Gradio:
For development
gradio src/app.py
For normal deployment/execution
python src/app.py
-
Go to your browser at the following address :
-
├── readme.md
├── requirements.txt
├── screenshots
└── src
├── app.py
└── assets
├── dataset
├── ml
└── tmp
7 directories, 4 files
Gradio App |
---|
Here are some resources you could explore to get a good understanding of Streamlit :
Feel free to make a PR or report any issue, Thanks in advance 😃.
Oh, one more thing, please do not forget to put a description when you make your PR 🙂.