How 0xvitae/ns-archaeology-hackathon-001 works
1. Repository shape
This is a mostly file-based geospatial analysis pipeline, not a conventional app with a database. The core outputs are CSV, GeoJSON, HTML map layers, and annotated images stored under data/, with notebooks used for exploratory work and small Python scripts used for repeatable steps.
2. Primary workflow
The project moves through a staged pipeline: collect external archaeological datasets, consolidate them into a master catalog, derive areas of interest (AOIs), fetch satellite tiles for those AOIs, run AI-based tile analysis, then review and annotate the highest-confidence candidates in a browser-based viewer.
3. Data ingestion boundary
data/external/ is the raw/reference-data boundary. It contains sources from UNESCO, academic CSVs, government SIGDA exports, OpenStreetMap, Wikidata/Wikipedia, other curated sources, and YouTube transcript-derived material. These are treated as inputs, not working outputs.
4. Master dataset consolidation
data/master/ holds the normalized cross-source site catalog, with all_sites_master.csv and all_sites_master_cleaned.csv as central reference tables. scripts/clean_master.py is the obvious normalization step that turns heterogeneous source data into a consistent master list used downstream.
5. AOI discovery and selection
data/checkpoint_2/ represents the AOI discovery stage. It contains merged AOI layers, filtered survey areas, top-ranked candidate AOIs, and thematic overlays like river candidates and desert unexplored zones. The notebooks in notebooks/checkpoint_2/ and scripts/merge_aoi.py are the main producers here.
6. Spatial context layers
data/layers/ adds domain-specific reference geometry such as ancient river systems and Norte Chico river valleys. These layers feed the AOI reasoning and the map viewer as contextual overlays, helping rank or interpret candidate sites against hydrology and settlement patterns.
7. Satellite tile acquisition
data/checkpoint_3/ is the imagery capture stage. scripts/grab_tiles.py and notebooks/checkpoint_3/grab_tiles.ipynb generate a tile_manifest.csv and store the tile images under data/checkpoint_3/tiles. The README makes clear this stage depends on the Google Maps Static API at zoom 18, so this is the main external data-fetching boundary.
8. AI analysis and detection
data/checkpoint_4/ contains the analysis outputs: analysis_results.csv, analysis_results.geojson, and pipeline_selection.geojson. scripts/analyze_tiles.py is the analysis stage that sends tiles to Google Gemini for archaeological feature detection, producing confidence-ranked detections and candidate selections.
9. Annotation stage
scripts/annotate_sites.py and notebooks/checkpoint_4/annotate_sites.ipynb handle post-processing of strong detections into human-reviewable overlays. This is where the project turns machine-detected candidates into visually annotated artifacts for inspection and reporting.
10. Review interface and orchestration
viewer.html is the main front-end review surface, served by scripts/server.py. The Flask server exposes pipeline-control endpoints (/api/run-pipeline, /api/pipeline-status, /api/pipeline-logs, /api/datasets) and supports interactive review features like confidence filtering, dataset overlays, and live log streaming.
11. Notebook vs. script boundary
The notebooks are organized by checkpoint and appear to be the research/prototyping layer, while the scripts are the operational layer that the server and repeatable pipeline actions rely on. This separation is important for the architecture diagram: notebooks generate and explain results, scripts execute the pipeline, and the viewer consumes the resulting files.
12. Notable side subsystem
scripts/yt_archaeology/ is a separate mini-application for processing YouTube archaeology content, with its own scanner/server assets and transcript index. It appears adjacent to the main satellite-detection pipeline rather than central to it, but it contributes an additional evidence source under data/external/youtube/.
Main entry points: checkpoint_2 AOI layers · analyze_tiles.py Tile analysis · viewer.html Viewer UI · checkpoint_4 Analysis outputs
Components 20
Raw inputs
External and contextual source data treated as inputs to the pipeline.
- External sources · Raw archaeological and reference inputs from curated external collections.
data/external - Spatial layers · Domain context layers such as river systems and valley geometry.
data/layers
Core pipeline
Staged processing from normalization through AOI discovery, tile capture, analysis, and annotation.
- Master catalog · Cross-source site catalog used as the downstream reference table.
data/master - Clean master · Consolidates heterogeneous source data into the cleaned master list.
scripts/clean_master.py - AOI layers · Merged, filtered, and ranked areas-of-interest layers and maps.
data/checkpoint_2 - AOI merge · Produces merged AOI layers from notebooks and scripted transforms.
scripts/merge_aoi.py - AOI notebooks · Checkpoint 2 notebooks for ranking, hydrology, and AOI reasoning.
notebooks/checkpoint_2 - Tile manifest · Generated list of satellite tile requests and captured imagery references.
data/checkpoint_3/tile_manifest.csv - Tile grabber · Fetches satellite tiles for AOIs from the external map imagery API.
scripts/grab_tiles.py - Tile notebook · Notebook workflow for generating the tile manifest and imagery capture outputs.
notebooks/checkpoint_3/grab_tiles.ipynb - Tile analysis · Runs AI-based feature detection over tiles and emits ranked results.
scripts/analyze_tiles.py - Analysis outputs · Confidence-ranked detections and selected candidate geometries.
data/checkpoint_4 - Analyze notebook · Checkpoint 4 notebook for the detection stage and result inspection.
notebooks/checkpoint_4/analyze_tiles.ipynb - Annotate sites · Turns strong detections into human-reviewable annotated artifacts.
scripts/annotate_sites.py - Annotate notebook · Notebook for reviewing and annotating candidate sites.
notebooks/checkpoint_4/annotate_sites.ipynb
Review surface
Browser-based inspection and orchestration layer for reviewing pipeline outputs.
- Viewer UI · HTML front-end for exploring datasets, overlays, confidence filters, and annotations.
viewer.html - Pipeline server · Serves the viewer and exposes pipeline control, status, logs, and dataset endpoints.
scripts/server.py
YouTube mini-app
Adjacent subsystem for transcript-based archaeology evidence extraction.
- YouTube archaeology · Transcript and index processing for archaeology-related YouTube evidence.
scripts/yt_archaeology - YT scanner · Processes YouTube transcripts and supports the adjacent evidence-mining workflow.
scripts/yt_archaeology/scanner.py - YT server · Local server and UI assets for the YouTube archaeology subsystem.
scripts/yt_archaeology/server.py
Connections 22
- External sources → Clean master: source data · External source tables and geodata are normalized into the master catalog.
- Clean master → Master catalog: builds · Cleaning and consolidation produce the master site reference tables.
- Spatial layers → AOI layers: context · Hydrology and valley layers inform AOI discovery and ranking.
- Master catalog → AOI merge: inputs · The master catalog is used to derive and merge candidate AOIs.
- AOI merge → AOI layers: produces · AOI merging writes the checkpoint 2 spatial outputs.
- AOI notebooks → AOI merge: prototypes · Checkpoint 2 notebooks develop and explain AOI generation logic.
- AOI layers → Tile grabber: AOIs · Selected AOIs drive satellite tile acquisition.
- Tile grabber → Tile manifest: creates · Tile requests are recorded as a manifest for capture runs.
- Tile notebook → Tile grabber: experiments · Notebook workflow supports tile-grabbing and manifest generation.
- Tile manifest → Tile analysis: feeds · Captured tiles are analyzed for archaeological feature detection.
- Tile analysis → Analysis outputs: writes · Analysis results are stored as CSV and GeoJSON outputs.
- Analyze notebook → Tile analysis: reviews · Checkpoint 4 notebook documents and iterates on detection logic.
- Analysis outputs → Annotate sites: candidates · High-confidence detections are post-processed into annotations.
- Annotate notebook → Annotate sites: refines · Notebook workflow supports manual review and annotation artifacts.
- Annotate sites → Viewer UI: publishes · Annotated outputs are consumed by the browser-based viewer.
- AOI layers → Viewer UI: overlays · AOI layers are also visualized in the review interface.
- Analysis outputs → Viewer UI: results · Detection results are inspected in the viewer.
- Pipeline server → Viewer UI: serves · The Flask server hosts the review UI.
- Pipeline server → Tile analysis: orchestrates · Server endpoints can launch or monitor pipeline execution.
- YouTube archaeology → External sources: adjacent input · YouTube-derived evidence contributes to the broader external source boundary.
- YT scanner → YouTube archaeology: processes · The scanner is the main processing component of the YouTube subsystem.
- YT server → YouTube archaeology: hosts · The mini-app server exposes the subsystem UI and assets.