Coder Social home page Coder Social logo

laansdole / image-caption-pipeline Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 705 KB

FastAPI Production Setup with pipeline for HuggingFace image caption model

Home Page: https://huggingface.co/nlpconnect/vit-gpt2-image-captioning

Python 72.67% Dockerfile 27.33%
fastapi poetry docker-compose huggingface-transformers image-to-text

image-caption-pipeline's Introduction

FastAPI pipeline for Image Captioning Model

This project uses Python 3.10. Remember to run below commands in the root directory of your project where the pyproject.toml file is located. Here are the main elements you need to know to get started:

Virtual Environment

Note that for this the package venv is to be used.

In short, a virtual environment will help us manage an isolated version of python interpreter. And so too installed packages. In this way. Different project will not have to depends on the same packages installation and have to conflict. Read the link above explain and show it well.

Build on local

Docker Build

docker compose up --build

Poetry or Pip

# Create a virtual environment, navigate to your root directory and run:
python -m venv .venv
# Activate the environment, use:
source .venv/bin/activate
pip install -r requirements
  • In a Python project managed with Poetry, dependencies are listed in a pyproject.toml file, make sure that [tool.poetry] name = "bloomsage-backend":
poetry install --no-root

To add additional dependencies/packages to your project, use:

  • With poetry
poetry add [dependencies/packages]
  • With pip
pip install [dependencies/packages]
  • Once you have done with your session
# To export the requirements.txt
pip install -r requirements
poetry export -f requirements.txt --output requirements.txt --without-hashes --without=dev
# Deactivate the environment once done, use:
deactivate

To run locally

poe compose
  • To check the type in python files
poe typecheck

References

image-caption-pipeline's People

Contributors

laansdole avatar

Stargazers

Tuong-Minh (Mike) Vo avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.