1.环境搭建:
-
window 10 + git:
git拿来运行sketch-code中的项目命令行!! -
python 3.5:
python 3.5.2 下载:https://pan.baidu.com/s/1uTQlq9ajabGpuYVaE24vQg 密码:oj8e(官网下载太慢了!!)
安装:https://blog.csdn.net/qq_29202937/article/details/79404829
python 3.7 报错:python No matching distribution found for tensorflow 注意版本!! -
wget 1.11: 按照项目地址操作的时候需要wget
https://blog.csdn.net/wsp_1138886114/article/details/86698957 安装和配置环境即可!!
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