Skip to content

songquanpeng/pytorch-deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyTorch Deployment

A template for rapid deployment of PyTorch models.

点击以展开中文 README

功能

  • API.
  • Web 前端.
  • 支持图像转换模型.
  • 支持图像分类模型.
  • 支持图像生成模型.

演示

starganv2_afhq

部署步骤

  1. 安装依赖:pip install -r requirements.txt
  2. 启动服务,你有以下选择:
    1. flask run -p 3000,注意该方式性能较差。
    2. 使用 Gunicorn:
      1. 安装 Gunicorn:pip install gunicorn
      2. 启动应用:gunicorn -b 127.0.0.1:3009 app:app

请注意,模型的权重是从 Github 上下载的,如果你的服务器无法正常访问 Github,请手动下载权重并放到 data 文件夹下。

目前内置的模型:

Features

  • API.
  • Web frontend.
  • Support image translation models.
  • Support image classification models.
  • Support image generation models.

Demo

starganv2_afhq