GithubHelp home page GithubHelp logo

dimitreoliveira / torchserve_od_example Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 84.81 MB

Simple example of using TorchServe to serve a PyTorch Object Detection model

License: MIT License

Python 0.98% Shell 0.28% Dockerfile 0.11% Jupyter Notebook 98.62%
pytorch torchvision torchserve object-detection docker docker-compose faster-rcnn fasterrcnn fastrcnn

torchserve_od_example's Introduction

Simple example of using TorchServe to serve a PyTorch Object Detection model

Repository content

Local Setup

Optional

Docker Setup

General Setup

Download FastRCNN model weights

sh scripts/get_fastrcnn.sh

Run locally

Archive model

sh scripts/archive_model.sh

Start TorchServe

sh scripts/start_torchserve.sh

Stop TorchServe

torchserve --stop

Run with Docker

Build Docker image from the Dockerfile

sudo docker build -f Dockerfile -t docker_torchserve .

Run the Docker container

sudo docker run -p 8080:8080 -u 0 -ti -v $(pwd)/models/:/home/model-server/models/ docker_torchserve /bin/bash

Archive model

sh scripts/archive_model.sh

Start TorchServe

sh scripts/start_torchserve.sh

Stop TorchServe

torchserve --stop

Run with Docker compose

Build image and run with Build and run your app with Docker compose

sudo docker-compose up

Stop the application

docker-compose down

Inference

Run sample inference using REST APIs

curl http://127.0.0.1:8080/predictions/fastrcnn -T ./samples/man2.jpg

Or iteratively run the "query_notebook.ipynb" notebook

Content

  • models — Model's assets.
  • samples — Image samples used to test inference.
  • scripts — Scripts for general usage.
  • utils — Utility files.
  • query_notebook — Jupyter notebook for iterative inference.

References

torchserve_od_example's People

Contributors

dimitreoliveira avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

golang-backup

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.