Giter Site home page Giter Site logo

streamlit快速部署的基于AttnGAN的鸟类生成APP

AttnGAN论文

Pytorch implementation for reproducing AttnGAN results in the paper AttnGAN: Fine-Grained Text to Image Generation with Attentional Generative Adversarial Networks by Tao Xu, Pengchuan Zhang, Qiuyuan Huang, Han Zhang, Zhe Gan, Xiaolei Huang, Xiaodong He. (This work was performed when Tao was an intern with Microsoft Research).

论文地址:https://arxiv.org/abs/1711.10485

源码地址:https://github.com/taoxugit/AttnGAN

注:目前该鸟类生成APP AttnGAN部分与源码基本一致,源代码在python 2. 的版本上运行,本项目对其做了些许修改使其在python 3.6环境下成功运行。

Streamlit 快速部署

在code_2022/code/文件夹下新建app.py,编写代码

streamlit 代码编写可参考:

Streamlit:最快的方式建立和分享数据的工具 - 简书 (jianshu.com)

两种运行方式

  • 在share.streamlit.io上 运行(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!该方式暂运行不了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)

    ​ 1.将该项目Fork至自己的github主页中

    fork

    ​ 2.找到自己github主页中的app.py文件,复制其网址

    address

    ​ 3.用github账号登录https://share.streamlit.io/, 选择New app->Paste GitHub URL->粘贴刚刚的app.py网址后Deploy!

    ​ Streamlit Cloud官方教程: https://docs.streamlit.io/streamlit-cloud/get-started <!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!该方式暂运行不了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!>

  • 本地运行

    ​ 环境需求:python 3.6

    ​ 1.下载该项目到本地

    ​ 首先需要跑通AttnGAN代码,数据集等需要另外下载,其下载链接与存放位置参照博文:(21条消息) AttnGAN代码复现(详细步骤+避坑指南)文本生成图像_心源易码-CSDN博客

    ​ 2.在终端中进入 code_2022/code/ 目录

    ​ 可优先运行 python main.py --cfg cfg/eval_bird.yml --gpu 0 (gpu的序号可按本地实际情况更改),查看AttnGAN代码是否顺利跑通。文本在data/birds/example_filenames.txt指定的若干个txt中给出(本项目在此处已做改动),图片结果在models/bird_AttnGAN2/下

    ​ 原example_filenames.txt中指定文本略多,本地算力不足的可更改该txt中指定文件来减少输入文本

    ​ 注意预先确定AttnGAN已跑通再进行第三步运行app。

    ​ 3.在该目录下执行 streamlit run app.py,自动弹出网页

    runapp

目前网页运行效果

​ (待后期修改) app1 app2

Amanda's Projects

net- icon net-

根据课程工作量统计表,统计所有老师的工作量,并形成报表。

tac-gan icon tac-gan

A Tensorflow implementation of the Text Conditioned Auxiliary Classifier Generative Adversarial Network for Generating Images from text descriptions (https://arxiv.org/abs/1703.06412)

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.