How muhammademmadsiddiqui/ra-fr works
RA-FR is a research system for risk-aware face retrieval: prepare or select a face dataset, train an uncertainty-aware embedding model, evaluate retrieval, then apply RAFR to evaluated embeddings and uncertainty. The graph preserves the documented IMFDB and SCFace paths, model variants, and retrieval analysis. Some evaluation and RAFR internals are only partially sampled, so only documented or indexed relationships are shown; optional SCFace restoration tools are external.
Main entry points: __init__.py Model selection · datamodule.py Data loading · run.py Train and eval runner · lightning.py Metric learning
Components 21
Data preparation
- IMFDB preparation
preparation/step1_organize_folders.py - IMFDB metadata
preparation/step2_generate_metadata.py - SCFace preparation
- IMFDB dataset
datasets/imfdb.py - SCFace dataset
datasets/scface.py
Training and models
- Data loading
lightning_modules/datamodule.py - Train and eval runner
run.py - Metric learning
lightning_modules/lightning.py - Model selection
networks/__init__.py - R50-GeM
networks/network.py - ViTB-DN-GeM
networks/ViTB-DN-GeM.py - ViTB-DN-GGeM
networks/ViTB-DN-GGeM.py - Pooling functions
cirtorch/functional.py - Metric losses
losses/loss.py - Loss functions
losses/functional.py
Retrieval and risk
- Nearest-neighbor retrieval
utils/utils.py - RAFR uncertainty
rafr.py - Coverage utilities
utils/cp_utils.py
Result analysis
- Retrieval analysis
Visualizations
Other components
- Researcher
- Face restoration tools
Connections 23
- Researcher → IMFDB preparation: organizes images
README.md - IMFDB preparation → IMFDB metadata: precedes metadata
README.md - IMFDB metadata → IMFDB dataset: prepares dataset
README.md - Researcher → SCFace preparation: prepares images
README.md - SCFace preparation → SCFace dataset: prepares dataset
README.md - Face restoration tools → SCFace preparation: restores faces
README.md - Researcher → Train and eval runner: starts training
README.md - Train and eval runner → Data loading: configures loaders
run.py - Train and eval runner → Metric learning: starts training
run.py - Data loading → IMFDB dataset: loads dataset
lightning_modules/datamodule.py - Data loading → SCFace dataset: loads dataset
lightning_modules/datamodule.py - Metric learning → Model selection: selects model
lightning_modules/lightning.py - Model selection → R50-GeM: provides architecture
networks/__init__.py - Model selection → ViTB-DN-GeM: provides architecture
README.md - Model selection → ViTB-DN-GGeM: provides architecture
README.md - R50-GeM → Pooling functions: uses pooling
networks/network.py - ViTB-DN-GeM → Pooling functions: uses pooling
networks/ViTB-DN-GeM.py - Metric learning → Metric losses: computes loss
lightning_modules/lightning.py - Metric losses → Loss functions: delegates calculations
losses/loss.py - Researcher → RAFR uncertainty: applies RAFR
README.md - RAFR uncertainty → Nearest-neighbor retrieval: searches neighbors
rafr.py - RAFR uncertainty → Coverage utilities: uses coverage metrics
rafr.py - Researcher → Retrieval analysis: analyzes results
README.md