05 2021 档案

摘要:// ==UserScript== // @name 提取天猫SKU // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author 丛兴龙 / 阅读全文
posted @ 2021-05-18 14:42 太晓 阅读(485) 评论(0) 推荐(0)
摘要:from PIL import Image path = './test.png' # 加载图片 im = Image.open(path) # 显示图片 im.show() # 图片大小 w, h = im.size x, y = 0, 0 box = (x*w, y*h, (x+1)*w, (y 阅读全文
posted @ 2021-05-14 16:25 太晓 阅读(541) 评论(0) 推荐(0)
摘要:path = './test/' # 创建路径 def mkdir(path): if not os.path.exists(path): os.makedirs(path) # 查文件列表 os.listdir(path) # 判断是否为文件夹 os.path.isdir(path) # 判断是否 阅读全文
posted @ 2021-05-14 15:04 太晓 阅读(42) 评论(0) 推荐(0)
摘要:生成值范围在[0,1]的张量 a = torch.rand(5, 2, 3) 元素总数 a.numel() # 30 获取张量的形状 a.size() a.shape 取值(不参与计算) a.data # 不安全 a.detach() # 推荐 平均值,最大值,最小值 a.detach().mean 阅读全文
posted @ 2021-05-02 15:34 太晓 阅读(145) 评论(0) 推荐(0)
摘要:图片保存工具 # 图片张数 N = 16 # 通道数 C = 3 # 高度 H = 64 # 宽度 W = 32 image = torch.rand(N,C,H,W) # 路径 path = './' save_image(image, path) 阅读全文
posted @ 2021-05-02 15:25 太晓 阅读(2256) 评论(0) 推荐(0)