Pytorch-UNet icon indicating copy to clipboard operation
Pytorch-UNet copied to clipboard

test

Open WenBingo opened this issue 11 months ago • 0 comments

The pre-training file is tested after loading, but the result is completely wrong. I writer test.py base on predict.py

net = UNet(n_channels=3, n_classes=args.classes, bilinear=args.bilinear) state_dict = torch.load('./unet_carvana_scale0.5_epoch2.pth', map_location=device) mask_values = state_dict.pop('mask_values', [0, 1]) net.load_state_dict(state_dict)

mask = predict_img(net=net, full_img=image, scale_factor=args.scale, out_threshold=args.mask_threshold, device=device)

WenBingo avatar Sep 04 '23 09:09 WenBingo