Skip to content

vishwesh5/flask-pytorch-inference

 
 

Repository files navigation

Model Inference

Create conda environment

conda env create -f environment.yml

Download models

The required models can be downloaded from the following links:

  1. Chest X-Ray
  2. Animals Caltech

Outline

This repository contains the code for the following:

  1. Loading the .pt model using PyTorch
  2. Converting the model to ONNX format using PyTorch
  3. Model inference using ONNX model
  4. Web app for model inference using ONNX model

The web app can be found in app/ directory.

Web API Instructions

This is a sample flask application that uses Bootstrap for the Frontend UI and PyTorch for model inference.

How to Use

conda activate pytorch_inference
python app_chest_xray.py

Go to 127.0.0.1:4555 on your browser.

Test Images

The test images can be found in chest_xray_kaggle folder.

The test images have been obtained from Kaggle Chest X-Ray Competition.

Output

You should get a screen shown below.

Choose Browse and upload an image. Click Upload to get the output

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 98.2%
  • Other 1.8%