Skip to content

anustupdas/YOLO-Image-detection-service-Fast-API

Repository files navigation

MD Logo

From zero to production in less than a day

A template for hosting your ML solutions quickly with fastAPI

Website Media Distillery PyPI License: MIT Code style: black Linux Ask Me Anything ! PyPI - Python Version Awesome Badges

Do you have an amazing Machine Learning Solution but you are thinking you do not know how to create a webservice out of it? Well, this project exactly solves your problem. This repo can be used as a kickstarter to convert your local ML application into a running webservice that can be deployed to the server/local.

This is an example project that can help you understand how you can use the framework to design a FastAPI webservice that actually detects objects in an image with the help of YOLOv4 model that is generally used at Media Distillery.

In addition, you can also learn about other activities needed to deploy a solution to servers [Production], including:

  • Dependency management and packaging in Python using Poetry.
    • How a simple pyproject.toml looks like for poetry, can be found under each package.
    • How you can custom that pyproject.toml for your project specific needs.
  • Creating the deployable containers of the ML services using Docker.
    • Example Dockerfile can be found at:

      image-detection-service/docker/Dockerfile


Read the blog for more details!


Project Structure

image-service-foundation:

The foundation library may contain shared python code and functions that can be reused in several Python projects or services. For this project it mainly handels the functions that we frequently use to read configuration files and also functions that are needed to access ML models that are hosted in cloud [Google/ Dropbox]

Note

The name of the foundation package is a bit different from the other package as the foundation package is intended to be used by a wide variety or umbrella of projects and services of which image-detection-service is one, that can commonly use the functionalities of this package

image-detection-core:

The core library may contain python code that is core to a specific project which mainly deals with the business logic, such as model initialization, inference and data pre- or post-processing. For this project all main functions related to the inferencing of the yolo4 model along with all the pre and post-processing of the input image.

image-detection-service:

The purpose of the service package is to make the functionalities of the core accessible through a REST API. This Becomes the main entry point of the webservice which is used to detec objects in an Image.

Please read the README for each individual package.

You can replace "example-template" with your custom package names while renaming the packages and add custom packages as required. You may need to update other things as well depending on your intended use.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Authors

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •