SketchCode 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
SketchCode 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
SketchCode 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 MIT
开发语言 Python
操作系统 跨平台
软件类型 开源软件
开源组织
地区 不详
投 递 者 一君_
适用人群 未知
收录时间 2020-08-06

软件简介

SketchCode是一种深度学习模型,它采用手绘的Web原型并将其转换为有效的HTML代码,使用图像字幕体系结构从手绘网站线框生成HTML标记。

注意:此项目是概念验证;该模型性能依赖于类似于核心数据集的线框。

依赖

  • Python 3 (not compatible with python 2)
  • pip

安装依赖

pip install -r requirements.txt

用法示例

下载数据和预训练的权重:

# Getting the data, 1,700 images, 342mb
git clone https://github.com/ashnkumar/sketch-code.git
cd sketch-code
cd scripts

# Get the data and pretrained weights
sh get_data.sh
sh get_pretrained_model.sh

使用预训练的权重将示例绘制的图像转换为HTML代码:

cd src

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

一般用法

使用权重将单个图像转换为HTML代码:

cd src

python convert_single_image.py --png_path {path/to/img.png} \
      --output_folder {folder/to/output/html} \
      --model_json_file {path/to/model/json_file.json} \
      --model_weights_file {path/to/model/weights.h5}

将文件夹中的一批图像转换为HTML:

cd src 

python convert_batch_of_images.py --pngs_path {path / to / folder / with / pngs} \ 
      --output_folder {folder / to / output / html} \ 
      --model_json_file {path / to / model / json_file.json} \ 
      - -model_weights_file {path / to / model / weights.h5}

训练模型:

cd src

# training from scratch
# <augment_training_data> adds Keras ImageDataGenerator augmentation for training images
python train.py --data_input_path {path/to/folder/with/pngs/guis} \
      --validation_split 0.2 \
      --epochs 10 \
      --model_output_path {path/to/output/model}
      --augment_training_data 1

# training starting with pretrained model
python train.py --data_input_path {path/to/folder/with/pngs/guis} \
      --validation_split 0.2 \
      --epochs 10 \
      --model_output_path {path/to/output/model} \
      --model_json_file ../bin/model_json.json \
      --model_weights_file ../bin/pretrained_weights.h5 \
      --augment_training_data 1

使用BLEU分数评估生成的预测

cd src

# evaluate single GUI prediction
python evaluate_single_gui.py --original_gui_filepath  {path/to/original/gui/file} \
      --predicted_gui_filepath {path/to/predicted/gui/file}

# training starting with pretrained model
python evaluate_batch_guis.py --original_guis_filepath  {path/to/folder/with/original/guis} \
      --predicted_guis_filepath {path/to/folder/with/predicted/guis}
展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击加入讨论🔥(12) 发布并加入讨论🔥
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
Google TensorFlow 输入验证错误漏洞
整数溢出或超界折返
TensorFlow是一套用于机器学习的端到端开源平台。 Google TensorFlow 1.7.x及之前版本中存在缓冲区溢出漏洞,该漏洞源于网络系统或产品在内存上执行操作时,未正确验证数据边界,导致向关联的其他内存位置上执行了错误的读写操作。攻击者可利用该漏洞导致缓冲区溢出或堆溢出等。
CVE-2018-7575 MPS-2019-4495
2022-08-08 18:42
Google TensorFlow 缓冲区错误漏洞
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。 tensorflow-lite 1.15.4之前版本, 2.0.3版本, 2.1.2版本, 2.2.1版本,2.3.1版本中存在安全漏洞,该漏洞允许攻击者从堆分配的数组的边界之外进行写入和读取。
CVE-2020-15211 MPS-2020-13698
2022-08-08 18:42
Google TensorFlow数字错误漏洞
除零错误
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。 Google TensorFlow 存在安全漏洞,该漏洞源于tensorflow, tensorflow-cpu, tensorflow-gpu中的除以0错误。
CVE-2021-37640 MPS-2021-17239
2022-08-08 18:42
Google TensorFlow 代码问题漏洞
对因果或异常条件的不恰当检查
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。 TensorFlow 2.4.2,2.3.3,2.2.3,2.1.4版本存在代码问题漏洞,该漏洞源于SparseAdd中不完整的验证会导致攻击者可利用该漏洞利用未定义的行为(对空指针进行解引用),以及写入堆分配数据的边界之外。
CVE-2021-29607 MPS-2021-6376
2022-08-08 18:42
Google Tensorflow存在未明漏洞
内存泄漏
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。Google Tensorflow存在安全漏洞,攻击者可利用该漏洞导致内存泄漏。
CVE-2022-23578 MPS-2022-2005
2022-08-08 18:42
Google Tensorflow存在未明漏洞
可达断言
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。Google Tensorflow存在安全漏洞,攻击者可利用该漏洞通过修改SavedModel来导致拒绝服务,触发CHECK失败。
CVE-2022-23579 MPS-2022-2006
2022-08-08 18:42
Google TensorFlow数字错误漏洞
除零错误
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。 Google TensorFlow 存在安全漏洞,该漏洞源于TFLite 中除法的实现易受 0 错误除法的影响。
CVE-2021-37691 MPS-2021-17313
2022-08-08 18:42
Google TensorFlow 安全漏洞
缓冲区大小计算不正确
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。 TensorFlow 2.4.2,2.3.3,2.2.3,2.1.4版本存在安全漏洞,该漏洞源于tf.raw_ops.RaggedTensorToTensor缺少验证,攻击者可利用该漏洞可以利用一个未定义的行为如果输入参数为空。
CVE-2021-29608 MPS-2021-6377
2022-08-08 18:42
Google Tensorflow缓冲区溢出漏洞
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。Google Tensorflow存在缓冲区溢出漏洞,攻击者可利用该漏洞构建一个TFLite模型,允许对TFLite中数组的外部进行有限的读写。
CVE-2022-23560 MPS-2022-1987
2022-08-08 18:42
Google Tensorflow输入验证错误漏洞
整数溢出或超界折返
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。Google TensorFlow存在输入验证错误漏洞,该漏洞源于Range的实现会出现整数溢出,攻击者可利用该漏洞触发未定义的行为,或者在某些情况下,会触发大的分配。
CVE-2022-23562 MPS-2022-1989
2022-08-08 18:42
Google Tensorflow存在未明漏洞
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。Google TensorFlow存在安全漏洞,该漏洞源于TensorFlow使用tempfile.mktemp 来创建临时文件。目前没有详细漏洞细节提供。
CVE-2022-23563 MPS-2022-1990
2022-08-08 18:42
Google Tensorflow存在未明漏洞
可达断言
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。Google TensorFlow存在安全漏洞,攻击者可利用该漏洞通过更改磁盘上的 SavedModel来触发拒绝服务。
CVE-2022-23565 MPS-2022-1992
2022-08-08 18:42
Google Tensorflow资源管理错误漏洞
拒绝服务
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。Google Tensorflow存在资源管理错误漏洞,攻击者可利用该漏洞造成资源管理不当。
CVE-2022-23580 MPS-2022-2007
2022-08-08 18:42
TensorFlow 代码问题漏洞
空指针解引用
TensorFlow是一套用于机器学习的端到端开源平台。 TensorFlow 1.6.x及之前版本中存在代码问题漏洞,该漏洞源于网络系统或产品的代码开发过程中存在设计或实现不当的问题。
CVE-2018-7576 MPS-2019-4463
2022-08-08 18:42
Google tensorflow-lite存在未明漏洞
跨界内存写
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。 tensorflow-lite 1.15.4之前版本, 2.0.3版本, 2.1.2版本, 2.2.1版本,2.3.1版本中存在安全漏洞,攻击者可利用该漏洞观察到分段错误或仅内存损坏。
CVE-2020-15210 MPS-2020-13697
2022-08-08 18:42
Google TensorFlow缓冲区溢出漏洞
跨界内存写
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。 Google TensorFlow存在缓冲区溢出漏洞,该漏洞源于在受影响的版本中,“tf.raw_ops.FractionalAvgPoolGrad”的实现可能会访问堆分配缓冲区边界之外的数据。 目前没有详细的漏洞细节提供。
CVE-2021-37651 MPS-2021-17263
2022-08-08 18:42
Google TensorFlow输入验证错误漏洞
整数溢出或超界折返
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。 Google TensorFlow存在输入验证错误漏洞,攻击者可利用该漏洞使用大输入参数调用 `tf.image.resize`,那么TensorFlow进程将由于溢出导致的 `CHECK` 失败而崩溃。
CVE-2021-41199 MPS-2021-31968
2022-08-08 18:42
Google TensorFlow 输入验证错误漏洞
整数溢出或超界折返
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。 TensorFlow 2.4.2,2.3.3,2.2.3,2.1.4存在安全漏洞,攻击者可利用该漏洞可以通过“CHECK”触发拒绝服务。
CVE-2021-29584 MPS-2021-6392
2022-08-08 18:42
Google Tensorflow代码问题漏洞
空指针解引用
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。Google TensorFlow存在代码问题漏洞,攻击者可利用该漏洞导致崩溃。
CVE-2022-23577 MPS-2022-2004
2022-08-08 18:42
Google TensorFlow 安全漏洞
跨界内存写
Google TensorFlow是美国谷歌(Google)公司的一套用于机器学习的端到端开源平台。 Google TensorFlow 2.4.2,2.3.3,2.2.3,2.1.4版本存在安全漏洞,该漏洞源于tf.io.decode_raw的实现会产生不正确的结果,并在组合固定长度和更宽的数据类型时导致Python解释器崩溃。
CVE-2021-29614 MPS-2021-6365
2022-08-08 18:42
没有更多内容
加载失败,请刷新页面
点击加载更多
加载中
下一页
12 评论
55 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部