Main streamlit
web app script using port 8080
.
- port :
5000
- extension:
/predict
- method:
POST
- argument:
files = {'image_bytes': <bytes>}
- response:
{'class_id': <int>, 'class_name': <str>, 'probability': <float>}
A script to test cnn-api.py
.
- Pytorch
- Flask
- sqlite3
- PIL
I use Ubuntu 20.04
to develop this repository.
# Clone this repository
git clone https://github.com/fadamsyah/learn-api-cnn.git
# Change directory to the cloned repo
# Install miniconda https://conda.io/miniconda.html
conda install -c conda-forge mamba
# Create an environment
mamba env create -f environment.yml
# Grant run.sh the permission to run
chmod +x run.sh
bash -i run.sh