File size: 1,450 Bytes
8065faa | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | # Evaluation
`evaluate.py` evaluates a fine-tuned checkpoint against labelled test images.
Use `inference.py` instead for images without ground truth.
## Segmentation
```bash
python evaluate.py \
--config configs/aff_base_finetune_512_fpw.yaml \
--checkpoint AFFMAE_BASE_FT_512
```
The paper reports mean Intersection over Union (mIoU) and the filtration-slits
class IoU. Results are summarized as mean ± standard deviation across four
random seeds.
## FPW geometry
```bash
python evaluate.py \
--config configs/aff_base_finetune_512_fpw.yaml \
--checkpoint AFFMAE_BASE_FT_512 \
--mode fpw --eval-grid-size 1024 \
--out-json output/fpw.json
```
The geometry pass recovers connected PGBMI segments from the segmentation,
forms a one-pixel-wide ordered centerline for each segment, detects filtration
slits, and projects the slit locations onto that centerline. Arc length between
successive slit locations represents foot-process width. Predicted and
ground-truth segments are paired geometrically before their mean widths are
compared. FPW MAE: the mean per-image absolute pixel error
`|FPW_pred - FPW_GT|`, with distances scaled to a 1024×1024 reference grid.
```bash
python evaluate.py --config configs/aff_base_finetune_512_fpw.yaml \
--mode fpw --seeds 42,77,2026,31415 \
--checkpoint 'output/fpw_seed{seed}/last_model.pth'
```
Use `--vis-dir output/fpw_geometry` to render matched PGBMI centerlines and slit
locations. |