How alfredqin/db-sam works
Project type and purpose
• This is a research‐oriented deep learning framework (“DB‐SAM”) for universal medical image segmentation, implementing the “Dual-Branch Adapted SAM” architecture on top of Meta’s Segment Anything Model.
• It provides configuration management, model definition (ViT branch + conv branch + fusion + decoder), training loops, inference scripts, experiment scaffolding, logging integrations, and CUDA operator compilation.
File structure
• Top‐level:
• configs/ (Hydra-style YAML presets for data, model, trainer, callbacks, logging, experiments)
• src/ (core library: data modules, model adapters/encoders/decoders, losses, ops, training engine, utils)
• projects/ (example applications: db_sam training pipeline, inference pipeline)
• scripts/, Makefile, environment.yaml, requirements.txt, setup.py/pyproject.toml (build & deployment)
• .github/, pre-commit, CI/CD workflows
• Patterns & frameworks:
• Hydra for config composition
• PyTorch + custom CUDA ops (Deformable Attention)
• Modular model registry (registry.py)
• Accelerate & custom Trainer classes
• Logging backends pluggable via configs (wandb, mlflow, comet, etc.)
README for additional insights
• Confirms dual‐branch (ViT + conv) architecture, cross‐attention fusion, mask decoder
• Usage instructions emphasize environment setup, CUDA op compilation, and standard training/inference entry scripts