1 Star 2 Fork 0

wangjialei1998/neural-style-tf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
stylize_image.sh 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
Cameron 提交于 2016-10-11 22:40 . Added verbose to usage script
set -e
# Get a carriage return into `cr`
cr=`echo $'\n.'`
cr=${cr%.}
if [ "$#" -le 1 ]; then
echo "Usage: bash stylize_image.sh <path_to_content_image> <path_to_style_image>"
exit 1
fi
echo ""
read -p "Did you install the required dependencies? [y/n] $cr > " dependencies
if [ "$dependencies" != "y" ]; then
echo "Error: Requires dependencies: tensorflow, opencv2 (python), scipy"
exit 1;
fi
echo ""
read -p "Do you have a CUDA enabled GPU? [y/n] $cr > " cuda
if [ "$cuda" != "y" ]; then
device='/cpu:0'
else
device='/gpu:0'
fi
# Parse arguments
content_image="$1"
content_dir=$(dirname "$content_image")
content_filename=$(basename "$content_image")
style_image="$2"
style_dir=$(dirname "$style_image" )
style_filename=$(basename "$style_image")
echo "Rendering stylized image. This may take a while..."
python neural_style.py \
--content_img "${content_filename}" \
--content_img_dir "${content_dir}" \
--style_imgs "${style_filename}" \
--style_imgs_dir "${style_dir}" \
--device "${device}" \
--verbose;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/wangjialei1998/neural-style-tf.git
git@gitee.com:wangjialei1998/neural-style-tf.git
wangjialei1998
neural-style-tf
neural-style-tf
master

搜索帮助