sketch-code 草图自动生成HTML

1.环境搭建:

2.项目地址:

sketch-code: https://github.com/ashnkumar/sketch-code

步骤1

安装了git,随意在一个盘符中,“右键”–> “Git Bash Here”–>在窗口中拉取项目:

git clone https://github.com/ashnkumar/sketch-code.git

拉取的项目如下:
在这里插入图片描述

步骤2

安装依赖:cmd到拉取的项目根路径下(python 3.5安装好)
在这里插入图片描述

pip install -r requirements.txt

这是requirements.txt文件中的内容,没有的话,创建一个

Keras==2.1.2
tensorflow==1.4.0
nltk==3.2.5
opencv-python==3.3.0.10
numpy==1.13.1
h5py==2.7.1
matplotlib==2.0.2
Pillow==4.3.0
tqdm==4.17.1
scipy==1.0.0

pip下载依赖慢的话,可以配置镜像:https://blog.csdn.net/qq_24671941/article/details/84109697

步骤3

cmd到下拉的项目目录:sketch-code\scripts下---->右键“”—>“Git Bash Here”
在这里插入图片描述
依次输入命令:

sh get_data.sh
sh get_pretrained_model.sh

官方的那个有斜杠,复制笔者的就可以了!

python convert_single_image.py --png_path ../examples/drawn_example1.png  --output_folder ./generated_html  --model_json_file ../bin/model_json.json  --model_weights_file ../bin/weights.h5

根据路径下的图片“…/examples/drawn_example1.png” 生成html
到项目src目录看看最后的成果吧!!
在这里插入图片描述

csdn博客非windows
https://blog.csdn.net/weixin_40193776/article/details/80261048

原创文章 19 获赞 109 访问量 19万+

猜你喜欢

转载自blog.csdn.net/qq_40670946/article/details/92772979