🧙 Develop
Prolix is a lightweight command‑line tool that runs YOLO‑based object detection and classification on Panoramax pictures. The code is split into a handful of thin, well‑defined modules that make adding new models or analysis pipelines straightforward.
Repository layout
prolix/
├─ main.py # Typer CLI – the public entry point
├─ runners/ # Per-feature detection modules
├─ analyzers/ # De-duplicate and summarize detections
├─ utils/ # Helper classes (Annotation, Crop, etc.)
├─ upload_annotations.py # Send annotations to Panoramax API
└─ loggers.py # Display progress in processing
Core concepts
| Layer | Responsibility | Typical files |
|---|---|---|
| Runners | Loads a model, runs inference, returns a list of Crop or Prob objects |
runners/*.py |
| Analyzers | Post‑processes runner output: dedupe, clustering, export | analyzers/*.py |
| Models | Configuration for a YOLO/transformer checkpoint, download helper | models.py |
How a command flows
- CLI (in
main.py) calls a runner or analyzer. - A runner loads the corresponding model (
Model,HFModel, …) and runs inference viarunners.detectorrunners.classifier. - The runner returns low‑level objects (
Crop,Prob). The analyzer converts them to Locate‑Object format, clusters, and finally writes GeoJSON files. - Optional upload step uses
upload_annotations.upload_from_geojson.
Makefile shortcuts
| Target | Description |
|---|---|
fmt |
Run ruff auto‑formatting |
lint |
Run ruff linter |
type-check |
Run mypy |
docs |
Build MkDocs static site |
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. To contribute, you can:
- Fork the repo and create a feature branch.
- Add or update documentation in
docs/. - Ensure
make fmt lint type-checkall pass. - Open a merge request with a clear description of the change.