How jiacongfang/petal works
PETAL is an image-to-image photographic style-transfer inference project. Its primary workflow pairs content and reference images by filename stem, encodes their LAB photographic characteristics, and uses the embeddings to guide an adaptive LUT model that produces stylized images. A separate PST50 workflow runs or reuses predictions and evaluates them against paired ground truth. The README documents both workflows; the supplied excerpts show inference and model internals, but not all benchmark wiring.
Main entry points: benchmark_pst50.py PST50 runner · infer.py Run transfer · models_style_encoder.py Style encoder · paired_gt Paired ground truth
Components 16
Inference workflow
- Pair images
infer.py - Image preparation
infer.py - Run transfer
infer.py - Stylized images
infer.py
Transfer models
- Style encoder
models_style_encoder.py - LAB histograms
models_style_encoder.py - ViT embedding
models_style_encoder.py - Adaptive LUT
models_lut.py
Transformer layers
- ViT components
layers
PST50 evaluation
- PST50 runner
benchmark_pst50.py - PST50 pairs
data/PST50 - Predictions
benchmark_pst50.py - Quality metrics
benchmark_pst50.py - Paired ground truth
data/PST50/paired_gt
Other components
- Image user
- Benchmark user
Connections 16
- Image user → Pair images: provides directories
- Pair images → Image preparation: pairs by stem
- Image preparation → Run transfer: prepared images
- Run transfer → Style encoder: encodes style
- Style encoder → LAB histograms: extracts statistics
- Style encoder → ViT embedding: produces embedding
- ViT embedding → ViT components: uses components
- Run transfer → Adaptive LUT: guides transfer
- Run transfer → Stylized images: writes images
- Benchmark user → PST50 runner: starts evaluation
- PST50 runner → PST50 pairs: reads pairs
- PST50 runner → Run transfer: runs transfer
- PST50 runner → Predictions: writes or reuses
- Predictions → Quality metrics: evaluates against
- PST50 runner → Paired ground truth: reads references
- Paired ground truth → Quality metrics: provides comparison