How valeoai/naf works
NAF is a zero-shot feature upsampler: an image guides the conversion of low-resolution Vision Foundation Model features to a requested higher resolution. The repository also provides alternative upsamplers, image restoration/denoising, and downstream depth, segmentation, and video-segmentation evaluation. Edges are limited to README statements and relationships visible in the sampled source or SOURCE INDEX; unsampled evaluation/model wiring is left unasserted.
Main entry points: naf.py NAF Upsampler · training.py Training Utilities · denoising.py Denoising Workflow · eval_video_seg.py Video Segmentation
Components 23
Feature Upsampling
- Hub Loader
hubconf.py - NAF Upsampler
src/model/naf.py - Alternative Upsamplers
src/model
Model Components
- ViT Backbone
src/backbone/vit_wrapper.py - Cross-Scale Attention
src/layers/attentions.py - Convolution Encoder
src/layers/convolutions.py - RoPE Encoding
src/layers/rope.py - JAFAR Upsampler
src/model/jafar.py - FeatUp Upsampler
src/model/featup.py - Joint Bilateral
src/model/jbu.py - IRCNN Model
src/model/ircnn.py - REDNet Model
src/model/rednet.py - Restormer
src/model/restormer.py
Training and Restoration
- Feature Training
train.py - Training Utilities
utils/training.py - Denoising Workflow
denoising.py - Image Utilities
utils/img.py - Feature Loss
src/loss.py
Downstream Evaluation
- Depth Probing
evaluation/eval_depth_probing.py - Segmentation Probing
evaluation/eval_seg_probing.py - Video Segmentation
evaluation/eval_video_seg.py - Evaluation Datasets
evaluation/dataset
Other components
- User
Connections 24
- User → Hub Loader: loads model
README.md - Hub Loader → NAF Upsampler: loads
hubconf.py - User → NAF Upsampler: supplies image, features
README.md - NAF Upsampler → Cross-Scale Attention: applies attention
src/model/naf.py - NAF Upsampler → Convolution Encoder: encodes image
src/model/naf.py - NAF Upsampler → RoPE Encoding: encodes positions
src/model/naf.py - Cross-Scale Attention → RoPE Encoding: uses encoding
src/layers/attentions.py - Feature Training → Training Utilities: uses utilities
train.py - Training Utilities → ViT Backbone: loads backbone
utils/training.py - Training Utilities → Image Utilities: uses image helpers
utils/training.py - Denoising Workflow → Training Utilities: uses utilities
denoising.py - Denoising Workflow → IRCNN Model: trains model
- Denoising Workflow → REDNet Model: trains model
- Denoising Workflow → NAF Upsampler: trains model
- Depth Probing → Training Utilities: uses utilities
evaluation/eval_depth_probing.py - Segmentation Probing → Training Utilities: uses utilities
evaluation/eval_seg_probing.py - Video Segmentation → Training Utilities: uses utilities
evaluation/eval_video_seg.py - Video Segmentation → Evaluation Datasets: evaluates DAVIS data
- Depth Probing → NAF Upsampler: evaluates upsampler
- Segmentation Probing → NAF Upsampler: evaluates upsampler
- Video Segmentation → JAFAR Upsampler: evaluates upsampler
- FeatUp Upsampler → Joint Bilateral: uses stack
src/model/featup.py - JAFAR Upsampler → Convolution Encoder: uses encoder
src/model/jafar.py - Feature Loss → Depth Probing: used for probing
evaluation/eval_depth_probing.py