Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

T-Sumida/ml-api-fastapi

Open more actions menu

Repository files navigation

ml-api-fastapi

API demo of running a Tensorflow model using FastAPI.

A sample of running ImageNet-based Resnet50 on Docker as a REST-API on FastAPI. API demo of running a Tensorflow model using FastAPI.

Qiitaに記載されているコードはこちら

Demo

Environment

  • WSL2
  • pipenv
  • Docker

Requirement

  • tensorflow==2.3.0
  • fastapi
  • uvicorn
  • Jinja
  • aiofiles
  • python-multipart
  • opencv-python

All of these are listed in requirements_prod.txt.

Usage

Building the Development Environment

$git clone https://github.com/T-Sumida/ml-api-fastapi.git
$cd ml-api-fastapi
$pipenv install

Model Create

$pipenv run create

SavedModel will be output under models.

Docker Deploy

# build docker image
$pipenv run build

# start docker container
$pipenv run start


# stop docker container
$pipenv run stop

Go to http://localhost:8000/docs

For Authorize in the upper right corner of the docs, enter the value of API_KEY in the .env file.

Author

T-Sumida

About

Machine learning API implementation using FastAPI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
Morty Proxy This is a proxified and sanitized view of the page, visit original site.