摘要: BMPBMP文件: bmp文件主要包含4个部分,分别为文件头,信息头,调色板(大多数没有),图像数据。 一、文件头 文件头描述了该文件的信息,定义如下: #pragma pack (push, 1) struct _file_header { unsigned short fileType; uns 阅读全文
posted @ 2022-01-07 14:04 bairuiworld 阅读(683) 评论(0) 推荐(0) 编辑
摘要: cv2.reisze, interpolate采样比较torchresize, unsample, interpolate 本文比较cv2.reisze, PIL.Image.resize, torch.nn.functional.interpolate, mxnet torch interpola 阅读全文
posted @ 2022-01-07 13:45 bairuiworld 阅读(1183) 评论(0) 推荐(0) 编辑
摘要: torch内置模型 使用 打印支持的模型: print(dir(torchvision.models)) 下载模型,加上pretrained=True参数,会自动下载预训练好的模型: resnet18 = models.resnet18(pretrained=True) Downloading: " 阅读全文
posted @ 2022-01-07 11:53 bairuiworld 阅读(308) 评论(0) 推荐(0) 编辑
摘要: torch与onnx转换 一、pytorch转onnx pytorch官方已经提供了支持。 import torch dummy_input = torch.randn(1, 3, 480, 640) torch.onnx.export(model, dummy_input, 'net_640x48 阅读全文
posted @ 2022-01-07 11:20 bairuiworld 阅读(2194) 评论(0) 推荐(0) 编辑