-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (53 loc) · 2.25 KB
/
Copy pathMakefile
File metadata and controls
66 lines (53 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# GeoLeaf PoC — Makefile
# One-command targets for the full experimental pipeline.
# All targets assume the venv has been activated (or use `make setup` first).
SHELL := /bin/bash
PYTHON ?= python
VENV ?= .venv
CONFIG ?= config/base.yaml
GPU_CONFIG ?= config/a100.yaml
.PHONY: help setup download preprocess tier1 tier2 tier3 figures all clean lint
help:
@echo "GeoLeaf PoC — available targets:"
@echo " make setup Create venv and install requirements"
@echo " make download Download all data sources to data/"
@echo " make preprocess Co-register rasters, build train/val/test tiles"
@echo " make tier1 Run Tier 1 CHM-threshold baseline (~5 min A100, ~30 min CPU)"
@echo " make tier2 Run Tier 2 weak-supervision ensemble"
@echo " make tier3 Run Tier 3 Prithvi LoRA fine-tune"
@echo " make figures Regenerate Figure 2 with real numbers"
@echo " make all Full pipeline: download -> preprocess -> tier1 -> tier3 -> figures"
@echo " make clean Remove cached files (preserves data/ and outputs/)"
@echo " make lint Compile-check all .py files"
@echo ""
@echo "Override defaults: make tier3 GPU_CONFIG=config/t4.yaml"
setup:
$(PYTHON) -m venv $(VENV)
source $(VENV)/bin/activate && pip install --upgrade pip wheel
source $(VENV)/bin/activate && pip install -r requirements.txt
@echo "Setup complete. Activate with: source $(VENV)/bin/activate"
download:
$(PYTHON) scripts/download_data.py --config $(CONFIG)
preprocess:
$(PYTHON) scripts/preprocess.py --config $(CONFIG)
tier1:
$(PYTHON) scripts/tier1_baseline.py --config $(CONFIG)
tier2:
$(PYTHON) scripts/tier2_ensemble.py --config $(CONFIG)
tier3:
$(PYTHON) scripts/tier3_lora_finetune.py --config $(CONFIG) --gpu-config $(GPU_CONFIG)
figures:
$(PYTHON) scripts/make_figures.py --config $(CONFIG)
all: download preprocess tier1 tier3 figures
@echo "Full pipeline complete. Check outputs/."
clean:
find . -type d -name '__pycache__' -exec rm -rf {} +
find . -type d -name '.ipynb_checkpoints' -exec rm -rf {} +
find . -type f -name '*.pyc' -delete
@echo "Cleaned cache files. data/ and outputs/ preserved."
lint:
@for f in scripts/*.py; do \
echo "Compile-check $$f"; \
$(PYTHON) -m py_compile $$f || exit 1; \
done
@echo "All scripts parse OK."