https://github.com/zeinhasan/flask-api-model-deployment-tutorial
Tutorial for Model Deployment using Flask on Google Cloud
https://github.com/zeinhasan/flask-api-model-deployment-tutorial
Last synced: 10 months ago
JSON representation
Tutorial for Model Deployment using Flask on Google Cloud
- Host: GitHub
- URL: https://github.com/zeinhasan/flask-api-model-deployment-tutorial
- Owner: zeinhasan
- License: mit
- Created: 2024-04-17T15:29:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-19T14:57:37.000Z (over 1 year ago)
- Last Synced: 2025-01-02T11:28:58.528Z (12 months ago)
- Language: Python
- Size: 19.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flask-API-Model-Deployment-Tutorial
Tutorial for Model Deployment using Flask on Google Cloud
# Streamlit APP Demo link
https://predict-concrate-condition-531.streamlit.app/
## Instalation Guide
1. Download or clone this repository
2. Unzip/extract all file
3. Build Docker image using
```
docker buildx build -f Dockerfile -t .
```
4. Run it
```
docker run
```
## Testing on Postman
### 1. Normal Version
#### Method: POST
>```
>http://127.0.0.1:5321/predict
>```
#### Body form data
|Param|value|Type|
|---|---|---|
|image|/D:/Skripsi/Bismillah/Analisis/Dataset/Test/Positive/16001.jpg|file|
|model_name|concrate|text|
|offset|7|text|
|user_id|112448|text|
#### Response
```json
{
"User_ID": "112448",
"condition": "Positive",
"confidence": 1.0,
"time": "2024-04-17 17:22:19 UTC"
}
```
## 2. Without user_id
### Method: POST
>```
>http://127.0.0.1:5321/predict
>```
### Body form data
|Param|value|Type|
|---|---|---|
|image|/D:/Skripsi/Bismillah/Analisis/Dataset/Test/Positive/16010.jpg|file|
|model_name|concrate|text|
|offset|7|text|
|user_id||text|
### Response
```json
{
"error": "No user id provided"
}
```
## 3. Without offset
### Method: POST
>```
>http://127.0.0.1:5321/predict
>```
### Body form data
|Param|value|Type|
|---|---|---|
|image|/D:/Skripsi/Bismillah/Analisis/Dataset/Test/Positive/16009.jpg|file|
|model_name|concrate|text|
|offset||text|
|user_id|112448|text|
### Response
```json
{
"error": "No offset provided"
}
```
## 4. Without model_name
### Method: POST
>```
>http://127.0.0.1:5321/predict
>```
### Body form data
|Param|value|Type|
|---|---|---|
|image|/D:/Skripsi/Bismillah/Analisis/Dataset/Test/Positive/16009.jpg|file|
|model_name||text|
|offset|7|text|
|user_id|112448|text|
### Response
```json
{
"error": "No offset provided"
}
```
## 5. Without image
### Method: POST
>```
>http://127.0.0.1:5321/predict
>```
### Body form data
|Param|value|Type|
|---|---|---|
|image||file|
|model_name|concrate|text|
|offset|7|text|
|user_id|112448|text|
{
"error": "No image provided"
}
_________________________________________________
Powered By: [postman-to-markdown](https://github.com/bautistaj/postman-to-markdown/)