How castlechen339/dehazexl works
DehazeXL is a large-image haze-removal research implementation. Its main workflows are paired-image training on 8KDehaze and checkpoint-based inference on a hazy image; the README also documents global-context processing and attribution-map evaluation. The sampled decoder and training code establish the training/model connections, while test.py and several context modules were not sampled, so their internal wiring is not asserted.
Main entry points: decoder.py DehazeXL · train.py Training and Evaluation · hyper_attn.py HyperAttention · test.py Image Testing
Components 19
Haze Data
- Paired Haze Dataset
dataset.py
DehazeXL Model
- DehazeXL
models/DehazeXL/decoders/decoder.py - SwinV2 Backbone
models/DehazeXL/backbones/swin.py - Swin Decoder
models/DehazeXL/decoders/decoder.py - Decoder Utilities
models/DehazeXL/decoders/utils.py
Global Context
- Context Configuration
models/DehazeXL/context_encoders/__init__.py - Transformer-XL Context
models/DehazeXL/context_encoders/transformer_xl.py - LLM Attention
models/DehazeXL/context_encoders/attention.py - Attention MLA
models/DehazeXL/context_encoders/attentionmla.py - HyperAttention
models/DehazeXL/context_encoders/hyper_attn/attention/hyper_attn.py - Angular LSH
models/DehazeXL/context_encoders/hyper_attn/attention/angular_lsh.py - Attention Utilities
models/DehazeXL/context_encoders/hyper_attn/attention/utils.py - Flash Attention Kernel
models/DehazeXL/context_encoders/hyper_attn/attention/flash_attn_triton_for_hyper.py - ChatGLM Attention Adapter
models/DehazeXL/context_encoders/hyper_attn/attention/modeling_chatglm_fast_attention.py - LLM Attention Replacement
models/DehazeXL/context_encoders/hyper_attn/replace_llm_attention.py
Training and Inference
- Training and Evaluation
train.py - Image Testing
test.py - Model Checkpoint
Other components
- Researcher
Connections 16
- Researcher → Training and Evaluation: starts training
README.md - Researcher → Image Testing: tests image
README.md - Training and Evaluation → Paired Haze Dataset: loads pairs
train.py - Training and Evaluation → DehazeXL: trains model
train.py - Training and Evaluation → Model Checkpoint: saves weights
train.py - Image Testing → Model Checkpoint: loads weights
README.md - Image Testing → DehazeXL: runs inference
README.md - DehazeXL → SwinV2 Backbone: uses backbone
models/DehazeXL/decoders/decoder.py - DehazeXL → Swin Decoder: decodes features
models/DehazeXL/decoders/decoder.py - DehazeXL → Context Configuration: configures context
models/DehazeXL/decoders/decoder.py - DehazeXL → LLM Attention: uses attention
models/DehazeXL/decoders/decoder.py - DehazeXL → Decoder Utilities: uses utilities
models/DehazeXL/decoders/decoder.py - Context Configuration → Transformer-XL Context: selects context
- LLM Attention → HyperAttention: delegates attention
models/DehazeXL/context_encoders/attention.py - HyperAttention → Angular LSH: hashes tokens
models/DehazeXL/context_encoders/hyper_attn/attention/hyper_attn.py - HyperAttention → Attention Utilities: uses helpers
models/DehazeXL/context_encoders/hyper_attn/attention/hyper_attn.py