Views
No views yet
checkpoints/best_model.ptcheckpoints/vR.P.19_U_unet_resnet34_mqela_rgb.pthnotebooks/vR.P.19_U Image Detection and Localisation.ipynbvR.P.19_U1import segmentation_models_pytorch as smp
2import torch
3
4model = smp.Unet(
5 encoder_name="resnet34",
6 encoder_weights=None,
7 in_channels=9,
8 classes=1,
9 activation=None,
10)
11
12state = torch.load("checkpoints/best_model.pt", map_location="cpu", weights_only=False)
13weights = state.get("model_state_dict", state) if isinstance(state, dict) else state
14model.load_state_dict(weights, strict=False)
15model.eval()