Views
No views yet
| Parameter | Value |
|---|---|
| Epochs | 20 |
| Optimizer | Adam |
| Learning rate | 1e-4 |
| LR scheduler | ReduceLROnPlateau (factor=0.5, patience=3, min_lr=1e-6) |
| Batch size | 8 |
| Image size | 256×256 |
| GPU | NVIDIA GeForce RTX 3080 Ti |
| Dataset splits | train=800, val=100, test=100 |
| Split | Dice Coefficient | Loss |
|---|---|---|
| Validation (best) | 0.9036 | — |
| Test | 0.9169 | 0.3322 |
1import torch
2from model import UNet
3from safetensors.torch import load_file
4
5model = UNet(in_channels=3, num_classes=3)
6model.load_state_dict(load_file("model.safetensors"))
7model.eval()
8
9# input: (B, 3, 256, 256) float tensor in [0, 1]
10# output: (B, 3, 256, 256) logits — apply argmax(dim=1) for class map1from huggingface_hub import hf_hub_download
2from safetensors.torch import load_file
3from model import UNet
4
5weights = hf_hub_download(
6 repo_id="sebastiao-teixeira/week04-polyp-segmentation-unet-multiclass",
7 filename="model.safetensors",
8)
9model = UNet(in_channels=3, num_classes=3)
10model.load_state_dict(load_file(weights))
11model.eval()