python - TensorFlow png as x 和 html as y
问题描述
使用网络上的一些示例,我想出了这个解决方案,到目前为止还没有经过测试。tensorflow 有更多代码
import tensorflow as tf
from tensorflow.keras.layers import Dense, Flatten, Conv2D
from tensorflow.keras import Model
from lxml import html
import requests
import imgkit
tree = [0]*255
trees = [0]*255
for x in xrange(255):
page = requests.get(html)
tree[x] = html.fromstring(page.content)
imgkit.from_url(html, 'out.png')
trees[x] = tf.io.decode_png(
'out.png',
channels=0,
dtype=tf.dtypes.uint8,
name=None
)
# mnist = tf.keras.datasets.mnist
# (x_train, y_train), (x_test, y_test) = mnist.load_data()
(x_train, y_train), (x_test, y_test) = (trees[0:200], tree[0:200]), (trees[200:255], tree[200:255])
其余代码可在此处找到: https ://github.com/YunYang1994/TensorFlow2.0-Examples/blob/master/2-Basical_Models/CNN.py
这是否应该适用于从相似解决方案的给定屏幕截图创建 HTML?
事实证明,您需要导入 JS 和 CSS 才能接近正确的解决方案,然后您将近似为错误的所有将是后端,如果您为此编写代码可能会非常复杂。理想情况下,您只使用已被标记为对“tor”用户安全的网站;javascript 已禁用。
解决方案
推荐阅读
- c# - 用于下次启动的安全随机字符串 - C# / VB.Net
- reactjs - useState setter 函数在使用扩展运算符和多个 if 语句时不更新状态?
- python - PySpark - 从值列表中检查数据框的任何列中是否存在
- z3 - Z3 可以应用位宽缩减技术来解决位向量等价问题吗?
- c - 如何在 Android Studio 中使用带有 arm neon 指令的程序集编译 C 代码?
- javascript - 如何使用带有 JavaScript 的 DOMContentLoaded 显示我的本地存储的内容
- excel - VBA Excel - 文本框验证
- reactjs - 使用 APP.JS 的 npm start 找不到模块
- python - 使用图像处理检测皮肤图像中的血管
- python - Python argparse 可选破折号整数参数