上一页 1 2 3 4 5 6 7 8 9 ··· 32 下一页
摘要: n_samples = xs.shape[0] with tf.Session() as sess: # 记得初始化所有变量 sess.run(tf.global_variables_initializer()) writer = tf.summary.FileWriter('./graphs/li 阅读全文
posted @ 2022-02-15 10:43 xjspyx 阅读(97) 评论(0) 推荐(0) 编辑
摘要: void cvtColor( InputArray src, OutputArray dst, int code, int dstCn = 0 ); 功能:颜色空间转换 参数: src:原图 dst:保存转换后的图 dstCn:转换方式 阅读全文
posted @ 2022-02-15 10:35 xjspyx 阅读(16) 评论(0) 推荐(0) 编辑
摘要: double threshold( InputArray src, OutputArray dst, double thresh, double maxval, int type ); 功能:图像的二值化,就是将图像上的像素点的灰度值设置为 0 或 255,也就是将整个图像呈现出明 显的只有黑和白的 阅读全文
posted @ 2022-02-15 10:35 xjspyx 阅读(24) 评论(0) 推荐(0) 编辑
摘要: #迭代总轮次 n_epochs = 30 with tf.Session() as sess: # 在Tensorboard里可以看到图的结构 writer = tf.summary.FileWriter('./graphs/logistic_reg', sess.graph) start_time 阅读全文
posted @ 2022-02-15 10:10 xjspyx 阅读(143) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python3 import pymongo myclient = pymongo.MongoClient("mongodb://localhost:27017/") mydb = myclient["runoobdb"] mycol = mydb["sites"] 阅读全文
posted @ 2022-02-15 10:10 xjspyx 阅读(14) 评论(0) 推荐(0) 编辑
摘要: import torch.nn as nn import torch.nn.functional as F class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.conv1 = nn.Conv2d(3, 阅读全文
posted @ 2022-02-14 23:02 xjspyx 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 为面部数据集创建一个数据集类。我们将在 __init__中读取csv的文件内容,在 __getitem__中读取图片。这么做是为了节省内存 空间。只有在需要用到图片的时候才读取它而不是一开始就把图片全部存进内存里。 我们的数据样本将按这样一个字典{'image': image, 'landmarks 阅读全文
posted @ 2022-02-14 23:02 xjspyx 阅读(47) 评论(0) 推荐(0) 编辑
摘要: import torch.optim as optim criterion = nn.CrossEntropyLoss() optimizer = optim.SGD(net.parameters(), lr=0.001, momentum=0.9) 阅读全文
posted @ 2022-02-14 22:56 xjspyx 阅读(47) 评论(0) 推荐(0) 编辑
摘要: def show_landmarks(image, landmarks): """显示带有地标的图片""" plt.imshow(image) plt.scatter(landmarks[:, 0], landmarks[:, 1], s=10, marker='.', c='r') plt.pau 阅读全文
posted @ 2022-02-14 22:56 xjspyx 阅读(19) 评论(0) 推荐(0) 编辑
摘要: import urllib.request myURL1 = urllib.request.urlopen("https://www.runoob.com/") print(myURL1.getcode()) # 200 try: myURL2 = urllib.request.urlopen("h 阅读全文
posted @ 2022-02-14 22:45 xjspyx 阅读(142) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 32 下一页