Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ python model_test.py -t landsatMA
python model_test.py -t viirs
```

*Note: For a beginner-friendly, end-to-end evaluation script, check out the [examples/](./examples/) folder.*

---

## 📖 Citation
Expand Down
10 changes: 10 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Evaluation Example

This folder contains a minimal, end-to-end example to reproduce evaluation metrics on TIRAuxCloud pretrained models.

## Usage
1. Download the dataset and model weights from the TIRAuxCloud Hugging Face dataset page.
2. Populate the correct paths in `example_saved_model_run.json`.
3. Run the evaluation:
```bash
python examples/run_example_evaluation.py --subset landsat
10 changes: 10 additions & 0 deletions examples/example_saved_model_run.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"landsat": {
"dataset_dir": "./data/landsat_samples",
"dataset_folder": "./data/landsat_csvs",
"device": "cuda",
"cpuworkers": 4,
"batch_size": 8,
"model_path": "./models/pretrained_landsat.pth"
}
}
35 changes: 35 additions & 0 deletions examples/run_example_evaluation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import argparse
import json
import os
import subprocess
from pathlib import Path

def main():
parser = argparse.ArgumentParser()
parser.add_argument("--subset", type=str, default="landsat",
choices=["landsat", "landsatMA", "viirs"])
parser.add_argument("--config", type=str,
default="examples/example_saved_model_run.json")
args = parser.parse_args()

config_path = Path(args.config)
if not config_path.exists():
raise FileNotFoundError(f"Config file not found: {config_path}")

with open(config_path) as f:
cfg = json.load(f)[args.subset]

dataset_dir = Path(cfg["dataset_dir"])
dataset_folder = Path(cfg["dataset_folder"])

if not dataset_dir.exists():
raise FileNotFoundError(f"dataset_dir does not exist: {dataset_dir}")
if not dataset_folder.exists():
raise FileNotFoundError(f"dataset_folder does not exist: {dataset_folder}")

# Call existing script
cmd = ["python", "model_test.py", "-t", args.subset]
subprocess.run(cmd, check=True)

if __name__ == "__main__":
main()