fadamsyah / learn-api-cnn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

learn-api-cnn

Explanation

app.py

Main streamlit web app script using port 8080.

cnn-api.py

  • port : 5000
  • extension: /predict
  • method: POST
  • argument: files = {'image_bytes': <bytes>}
  • response: {'class_id': <int>, 'class_name': <str>, 'probability': <float>}

test-cnn-api.py

A script to test cnn-api.py.

Tools

  • Pytorch
  • Flask
  • sqlite3
  • PIL

How To Use

I use Ubuntu 20.04 to develop this repository.

Install

# 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

Run

bash -i run.sh

References

Sources:

About

License:MIT License


Languages

Language:Python 95.1%Language:Shell 4.9%