How mohalthaf/artifex works
ARTIFEX is a research prototype for brushstroke-aware restoration of Van Gogh paintings, with a local web demo for uploads and model comparison. Its research workflow prepares paintings and synthetic damage, trains a dual-stream inpainting model using brushstroke-related loss supervision, and evaluates restorations with standard and custom metrics. The demo exposes model discovery and inference through Flask and presents results and research evidence in Next.js. Connections involving the unsampled upload client and training pipeline are documented at the product level; some implementation wiring remains unverified.
Main entry points: app.py Flask API · ModelResultCard.jsx Restoration results · UploadZone.jsx Upload interface · page.jsx Demo page
Components 19
Research pipeline
- Dataset prep
scripts/preprocess_dataset.py - Synthetic damage
scripts/generate_realistic_masks.py - Model training
artifex_training.ipynb
Restoration service
- Dual-stream generator
artifex/server/ml/canonical_inference.py - Model registry
artifex/server/ml/model_registry.py - Image metrics
artifex/server/ml/metrics.py - Flask API
artifex/server/ml/app.py
Web experience
- Upload interface
artifex/client-next/components/UploadZone.jsx - API client
artifex/client-next/lib/api.js - Demo page
artifex/client-next/app/page.jsx - Restoration results
artifex/client-next/components/ModelResultCard.jsx - Before-after view
artifex/client-next/components/BeforeAfterSlider.jsx - Metric display
artifex/client-next/components/MetricBadge.jsx
Evaluation evidence
- Evidence dashboard
artifex/client-next/components/EvidenceDashboard.jsx - Evidence components
artifex/client-next/components/EvidenceComponents.jsx - Benchmark evaluation
scripts/evaluate_camera_ready.py - Statistical analysis
scripts/statistical_analysis_corrected.py
Other components
- Researcher
- Demo user
Connections 17
- Researcher → Dataset prep: prepares data
README.md - Dataset prep → Synthetic damage: generates masks
README.md - Researcher → Model training: trains model
README.md - Model training → Dual-stream generator: defines architecture
- Demo user → Upload interface: uploads image
- Upload interface → API client: sends request
- API client → Flask API: calls service
- Demo page → Upload interface: renders
- Demo page → Restoration results: renders
- Flask API → Model registry: reads models
artifex/server/ml/app.py - Flask API → Dual-stream generator: runs inference
artifex/server/ml/app.py - Flask API → Image metrics: computes metrics
artifex/server/ml/app.py - Restoration results → Before-after view: renders
artifex/client-next/components/ModelResultCard.jsx - Restoration results → Metric display: renders
artifex/client-next/components/ModelResultCard.jsx - Evidence dashboard → Evidence components: renders
artifex/client-next/components/EvidenceDashboard.jsx - Researcher → Benchmark evaluation: evaluates models
README.md - Benchmark evaluation → Statistical analysis: supports comparisons