How cvlab-kaist/tair works
This repository presents TeReDiff, a text-aware image-restoration system. The principal user workflow runs a low-quality image through the restoration pipeline, which uses diffusion and sampling components to produce a restored image; training is documented as separate restoration-only, text-spotting-only, and joint stages. The README also describes SA-Text and Real-Text datasets and a text-spotting module. Several connections below are based on README documentation rather than sampled implementation; the tree includes substantial Detectron2 code, but it is supporting infrastructure rather than the product’s main workflow.
Main entry points: pipeline.py Restoration pipeline · train.py Training entry point · transformer_detector.py Text detector · val.py Validation entry point
Components 15
Datasets
- SA-Text
- Real-Text
- Degradation transforms
terediff/dataset/degradation.py
Image restoration
- Restoration pipeline
terediff/pipeline.py - Restoration networks
terediff/model/unet.py - Diffusion samplers
terediff/sampler - Text encoder
terediff/model/open_clip/transformer.py
Text spotting
- Spotting data mapper
testr/adet/data/dataset_mapper.py - Text detector
testr/adet/modeling/transformer_detector.py - Spotting losses
testr/adet/modeling/testr/losses.py - Text evaluation
testr/adet/evaluation/text_eval_script.py
Training and evaluation
- Training entry point
train.py - Validation entry point
val.py
Other components
- Researcher
- Restored images
Connections 15
- Researcher → Restoration pipeline: runs inference
- Restoration pipeline → Restoration networks: uses restoration
- Restoration pipeline → Diffusion samplers: selects sampler
terediff/pipeline.py - Restoration pipeline → Text encoder: uses text conditioning
- Restoration pipeline → Restored images: produces images
- SA-Text → Training entry point: supplies training data
- Real-Text → Validation entry point: supplies evaluation data
- Degradation transforms → Training entry point: supports training
- Training entry point → Restoration networks: trains stage one
- Training entry point → Text detector: trains stage two
- Training entry point → Restoration pipeline: jointly trains stage three
- Spotting data mapper → Text detector: prepares inputs
- Text detector → Spotting losses: computes losses
- Text detector → Text evaluation: evaluates predictions
- Validation entry point → Restoration pipeline: runs validation