代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/deoldify 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
function usage {
echo '
_____ ____ _ _ _ __
| __ \ / __ \| | | (_)/ _|
| | | | ___| | | | | __| |_| |_ _ _
| | | |/ _ \ | | | |/ _` | | _| | | |
| |__| | __/ |__| | | (_| | | | | |_| |
|_____/ \___|\____/|_|\__,_|_|_| \__, |
__/ |
|___/
'
echo "usage : $0 notebook password -- to start the notebook with password"
echo " leave empty for no password (not recommended)"
echo "usage : $0 image_api -- to start image api"
echo "usage : $0 video_api -- to start video api"
echo ''
}
NOTEBOOK_PASSWORD=$2
if [ "$1" == "" ]; then
echo "missing first argument"
usage
else
#handling non GPU accelerated hardware
# if nvidia-smi not found => no ipc host
# --ipc=host
if nvidia-smi; then
IPC_HOST="--ipc=host"
echo "nvidia card found running on GPU"
else
IPC_HOST=""
echo "No nvidia card found running on CPU"
fi
already_built=$(rm -rf /tmp/deoldify.built; if docker image ls | grep deoldify > /tmp/deoldify.built; then echo "ok"; else echo "not ok"; fi; rm -rf /tmp/deoldify.built)
if [ "$already_built" == "ok" ]; then
echo "Docker started from cache"
echo "Access your $1 on port 5000 (api) or 8888 (notebook)"
docker run -it -p 8888:8888 -p 5000:5000 -e NOTEBOOK_PASSWORD=$NOTEBOOK_PASSWORD deoldify run_$1
else
docker build -t deoldify -f Dockerfile . && docker run -it -p 8888:8888 -p 5000:5000 -e NOTEBOOK_PASSWORD=$NOTEBOOK_PASSWORD deoldify run_$1
echo "Docker build and started"
echo "Access your $1 on port 5000 (api) or 8888 (notebook)"
fi
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。