How earthobservation/adaf works
Project type and purpose
• ADAF is a desktop/data-science tool (Python library + Jupyter interface) for automatic detection of archaeological features in airborne LiDAR (ALS) data.
• It uses RVT (Relief Visualisation Toolbox) for preprocessing, AiTLAS for CNN-based inference, and presents results in Jupyter or via a small widget interface.
File structure
Top-level folders:
• adaf/ ← Core Python package (inference, utils, visualization, widget, I/O pipelines)
• inference/ ← Example notebooks and scripts showing segmentation/object-detection workflows
• installation/ ← Installable wheels for GDAL and AiTLAS
• Notebooks & scripts at root for training and evaluation
• _wheels/ ← Bundled wheel files for offline install
• run_adaf.bat ← Entry-point script
Pull insights from the README
• ML models live in adaf/ml_models (external tar files ~5 GB), loaded at runtime.
• Dependencies: Python 3.8, GDAL, PyTorch (GPU optional), AiTLAS.
• Usage via Jupyter Notebook (ADAF_main.ipynb) or CLI scripts.
1. User Interfaces
• Jupyter Notebook (ADAF_main.ipynb)
• adaf_widget (if using the interactive widget)
• Optional CLI/Batch script (run_adaf.bat)
2. Core Processing Pipeline (adaf package)
• Data Loader & RVT preprocessing (grid_tools, create_patches)
• Inference Engine (adaf_inference → loads AiTLAS models)
• Post-processing & Visualization (adaf_vis, create_visualisations)
3. Model Storage
• adaf/ml_models directory (TAR files for segmentation & detection)
4. External Dependencies
• GDAL (geospatial I/O)
• AiTLAS framework
• PyTorch / CUDA
• Anaconda / Python runtime
b. Relationships & data flow
• User invokes Notebook or run_adaf.bat → calls into adaf_widget or adaf_inference
• Raw ALS data → GDAL reader → RVT preprocessing modules → patch generation
• Patches → Inference Engine → AiTLAS models (segmentation & object detection)
• Predictions → Post-processing → Visual outputs & metrics → Notebook / widget display
• Optionally: save results to disk (GeoTIFFs, shapefiles)
c. Architectural patterns & design principles
• Pipeline pattern: staged processing (preprocess → infer → postprocess)
• Modular separation: utils, I/O, inference, visualization in distinct modules
• Pluggable ML back-end: AiTLAS models are external, loaded dynamically
d. Key technologies & libraries
• Python 3.8
• GDAL (installed via wheel)
• PyTorch (CPU/GPU)
• AiTLAS (installed via wheel)
• Jupyter Notebook & ipykernel for interactive use
Every essential element
• Don’t forget the installation step: show “installation/_wheels → pip install → environment” as a side flow.
• Optional GPU path in the inference engine.
• Example notebooks in the “inference/” folder as variations on the core pipeline (segmentation vs. object-detection).