2022年7月6日

Python zipfile 压缩文件

摘要: zipfile 压缩普通文件文件 zip_file = zipfile.ZipFile("/tmp/2.zip", 'a', zipfile.ZIP_DEFLATED, False) zip_file.write("/tmp/6be69f6eb16c4aa1a8c861018f1a91fe.jpeg 阅读全文

posted @ 2022-07-06 16:00 星河赵 阅读(1102) 评论(0) 推荐(0) 编辑

Python 图片bytes PIL CV2 的相互转换

摘要: 1. PIL 与 cv2 相互转化 import cv2 from PIL import Image import numpy as np # PIL 转 cv2 img= Image.open("test.jpg") img = cv2.cvtColor(np.asarray(img), cv2. 阅读全文

posted @ 2022-07-06 10:50 星河赵 阅读(1208) 评论(0) 推荐(0) 编辑

导航