How patball1/detectree2 works
Main Components
• Data Input & Preparation:
• Raw imagery (orthomosaics) and crown data used for training.
• Utilities for tiling images and processing crown polygons.
• Data Loading:
• “data_loading” module, which contains scripts for pulling data from Google Drive, quickstarts, and even GEE downloads. These scripts handle interfacing with external geospatial data.
• Preprocessing:
• “preprocessing” package used to tile images and possibly prepare crown annotations.
• Custom cleaning (e.g., cleanCrowns.R) and transformation utilities.
• Model Training & Tuning:
• “models” module where training (including train_tune.py), prediction, and evaluation scripts are located.
• Integration with deep learning frameworks such as PyTorch/Detectron2 and highlight that GPU access (with CUDA) is recommended.
• Model Evaluation & Testing:
• Evaluation components in both the “models” submodule (evaluation.py) and tests within the “tests” directory.
• Process of comparing predictions with manually labeled crowns.
• R Analysis and Additional Workflows:
• That the project also includes an “R” directory (with scripts like change_analysis_mortality_growth.R) which indicates a cross-language analytical pipeline.
• Notebooks & Documentation:
• Notebooks (colab, exploratory, etc.) as examples/demonstrations of the workflow.
• Documentation folder (“docs”) and report sections that explain workflow or results.
• External Dependencies & Deployment:
• External libraries (GDAL, PyTorch, torchvision, etc.) and the underlying deep learning framework (Detectron2).
• CI/CD workflows (GitHub workflows, Makefile, Dockerfile) for testing/delivery.
Relationships & Data Flow
• Data Flow:
• Move into the Preprocessing module, which tiles the images and formats annotation data.
• Branch out to the Model Training/Tuning component where preprocessed data is used to train Mask R-CNN models.
• Then, connect to the Evaluation and Prediction modules where trained models are applied over test tiles or full regions.
• A feedback loop for model performance evaluation (via integration tests and notebooks).
• Interaction between Modules:
• That the “data_loading”, “preprocessing”, and “models” modules are tightly integrated and follow a pipeline from raw data to predictions.
• Demonstrate that components from “tests” validate each stage of the pipeline.
• That additional R-based analyses integrate into the overall ecosystem for change analysis.
Architectural Patterns & Design Principles
• Modularity:
• Each core functionality (data loading, preprocessing, modeling) is separated into its own module.
• Pipeline Layout:
• The system essentially implements a data pipeline where input data is transformed step by step.
• Extensibility:
• Showing “model_garden” with pre-trained models helps indicate how users can swap or update models.
• Integration / CI/CD:
• The presence of GitHub workflows along with Makefile and Dockerfile imply continuous integration/deployment practices.
Final Assembly
1) Tiling (Preprocessing)
2) Training/Tuning (Model Component)
3) Evaluation/Prediction (Testing/Output)
4) Analysis (R-based post-processing, reports, and interactive notebooks)