pytorch 图像分类预测本地图片
def prediect(img_path): img_src = cv2.imread(img_path, 0) #以灰度图的方式读取要预测的图片 img=img_src.copy() img = cv2.resize(img, (28, 28)) height,width=img.shape dst=np.zeros((height,width),np.uint8) for i in range(height): for j i...
原创
2021-11-10 14:01:24 ·
3624 阅读 ·
0 评论