How witchcraftcode/crackdetection works
This repository provides a concrete-crack image classifier and inspection toolkit. Its main workflow trains a binary classifier from labeled images, saves a model, then serves predictions through an image-upload API or runs them from scripts. The README also documents video, explanation, segmentation, edge export, drone simulation, architecture benchmarking, and metrics evaluation. The graph includes those distinct capabilities; connections for unsampled script internals rely on README documentation or SOURCE INDEX references, not inspected implementations.
Main entry points: inference.py Image Inference · train_classifier.py Classifier Training · segment_cracks.py Attention Masks · model.py Cached Model Helper
Components 18
Model Training
- Classifier Training
scripts/train_classifier.py - Classifier Architectures
src/architectures.py - Trained Classifier
Prediction Interfaces
- Prediction API
app.py - Cached Model Helper
model.py - Image Inference
src/inference.py
Inspection Tools
- Video Inference
scripts/video_inference.py - Image Explanations
scripts/explain_image.py - Attention Masks
scripts/segment_cracks.py - Segmenter Training
scripts/train_segmentation.py - U-Net Architecture
src/segmentation.py - Drone Simulation
scripts/drone_inspection_sim.py
Evaluation and Deployment
- Metrics Evaluation
scripts/evaluate_metrics.py - Architecture Benchmark
scripts/benchmark_architectures.py - Edge Model Export
scripts/export_edge_model.py
Other components
- Labeled Images
- API Client
- Image User
Connections 23
- Labeled Images → Classifier Training: trains on
README.md - Classifier Training → Classifier Architectures: selects architecture
scripts/train_classifier.py - Classifier Training → Trained Classifier: saves model
scripts/train_classifier.py - API Client → Prediction API: uploads image
README.md - Image User → Image Inference: requests prediction
README.md - Prediction API → Cached Model Helper: calls prediction
app.py - Cached Model Helper → Image Inference: loads and predicts
model.py - Trained Classifier → Cached Model Helper: loaded by
model.py - Trained Classifier → Video Inference: loads for frames
scripts/video_inference.py - Video Inference → Image Inference: loads model
scripts/video_inference.py - Trained Classifier → Image Explanations: explained by
README.md - Image Explanations → Image Inference: loads and preprocesses
scripts/explain_image.py - Trained Classifier → Attention Masks: generates attention mask
README.md - Attention Masks → Image Explanations: uses Grad-CAM
scripts/segment_cracks.py - Attention Masks → Image Inference: loads and preprocesses
scripts/segment_cracks.py - Labeled Images → Segmenter Training: provides paired images and masks
README.md - Segmenter Training → U-Net Architecture: builds U-Net
scripts/train_segmentation.py - Trained Classifier → Drone Simulation: used for inspection
README.md - Drone Simulation → Image Inference: uses prediction
scripts/drone_inspection_sim.py - Trained Classifier → Metrics Evaluation: evaluated by
README.md - Metrics Evaluation → Image Inference: uses preprocessing
scripts/evaluate_metrics.py - Classifier Architectures → Architecture Benchmark: benchmarked by
scripts/benchmark_architectures.py - Trained Classifier → Edge Model Export: exports for edge
README.md