How tinyaway/manet works
This is a PyTorch few-shot semantic-segmentation implementation of MANet, with an additional Hypercorrelation Squeeze Network (HSNet) implementation. The main workflow samples query/support episodes from Pascal or COCO, runs MANet, computes segmentation loss and intersection-over-union metrics, then updates and logs training results. The model uses a ResNet backbone and combines query/support features into mask and category predictions. HSNet’s correlation-based architecture is represented as a separate capability; the shown training loop imports it but does not instantiate it. Some dataset and model internals are only partially excerpted.
Main entry points: train.py Train / validate loop · model.py MANet · dataset.py Episode datasets · evaluation.py IoU evaluation
Components 15
Episode data
- Episode datasets
dataset.py - Episode loader
dataset.py
Segmentation models
- MANet
model.py - ResNet backbone
resnet.py - Mask and category heads
model.py - Hypercorr network
HSNet.py - Segmentation objective
model.py
Training and evaluation
- Train / validate loop
train.py - IoU evaluation
evaluation.py - Adam optimizer
train.py
Runtime support
- Metric aggregation
logger.py - Seed and device helpers
utils.py - Run logging and checkpoints
logger.py
Other components
- Experiment operator
- Pascal / COCO data
Connections 14
- Experiment operator → Train / validate loop: starts run
train.py - Train / validate loop → Episode datasets: initializes datasets
train.py - Episode datasets → Pascal / COCO data: reads images and masks
dataset.py - Train / validate loop → Episode loader: builds loaders
train.py - Episode loader → Episode datasets: batches episodes
dataset.py - Train / validate loop → MANet: predicts masks
train.py - MANet → ResNet backbone: constructs backbone
model.py - MANet → Mask and category heads: computes predictions
model.py - Train / validate loop → Segmentation objective: computes loss
train.py - Train / validate loop → Adam optimizer: updates parameters
train.py - Train / validate loop → IoU evaluation: scores predictions
train.py - IoU evaluation → Metric aggregation: updates IoU totals
train.py - Train / validate loop → Seed and device helpers: sets seeds and device
train.py - Train / validate loop → Run logging and checkpoints: logs and saves model
train.py