2 Star 11 Fork 4

sakoo/image-ai

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.py 2.00 KB
一键复制 编辑 原始数据 按行查看 历史
Sakoo 提交于 2023-04-17 14:29 . update ReadMe
import os
import gradio as gr
# removebg,changebg,repair-photo,human-cartoon,video-cartoon,ocr,cntext2image
if __name__ == '__main__':
removebg,changebg , repairPhoto,humanCartoon,videoCartoon,ocr,cntext2image= "removebg","changebg","repair-photo","human-cartoon","video-cartoon","ocr","cntext2image"
appNameDic={
removebg: "一键抠图",
changebg:"一键切换图片背景",
repairPhoto:"旧照片修复",
humanCartoon: "AI人像多风格漫画",
ocr: "多场景文字识别",
videoCartoon:"AI视屏卡通化",
cntext2image: "中文StableDiffusion-文本生成图像"
}
types = os.getenv('types','removebg,changebg')
concurrency_count = os.getenv("queue",2)
print("active types="+types)
actives = types.split(",")
appNameList = []
appList = []
for appKey in actives:
if appNameDic[appKey]:
print("激活app:"+appNameDic[appKey])
appNameList.append(appNameDic[appKey])
if appKey == removebg:
from pages.removebg import removeBgApplication
appList.append(removeBgApplication)
if appKey == changebg:
from pages.changebg import changeBgApp
appList.append(changeBgApp)
if appKey == humanCartoon:
from pages.humancartoon import humanCartoonApp
appList.append(humanCartoonApp)
if appKey == videoCartoon:
from pages.videocartoon import videoCartoonApp
appList.append(videoCartoonApp)
if appKey == repairPhoto:
from pages.photorepair import photoRepairApp
appList.append(photoRepairApp)
if appKey == cntext2image:
from pages.cntext2image import textCn2ImageApp
appList.append(textCn2ImageApp)
if appKey == ocr:
from pages.ocr import ocrApp
appList.append(ocrApp)
app = gr.TabbedInterface(appList,appNameList)
app.queue(concurrency_count=concurrency_count).launch(server_name="0.0.0.0")
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/dbapp/image-ai.git
git@gitee.com:dbapp/image-ai.git
dbapp
image-ai
image-ai
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385