# amedamsg/prjt_zonessattelites architecture

> Architecture diagram of the GitHub repository amedamsg/prjt_zonessattelites, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amedamsg/prjt_zonessattelites
- Repository: https://github.com/amedamsg/prjt_zonessattelites

## Overview

This repository implements land-cover image classification: images are decoded and resized, then a ConvNeXt-based model produces class probabilities. The principal serving path is an API request through prediction and response formatting; a separate training workflow prepares datasets, trains and evaluates the model, and saves a model artifact. A Streamlit application is also present, but its behavior cannot be established from the supplied excerpts. Connections below are limited to visible code; the README is empty.

Main entry points: [`src/models/training.py`](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/training.py) (Training Workflow), [`src/api/predict_api.py`](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/api/predict_api.py) (Prediction API), [`src/predictor/predictor.py`](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/predictor/predictor.py) (Predictor), [`src/models/config.py`](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/config.py) (Model Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_serving["Prediction Serving"]
  node_predictor["Predictor<br/>[predictor.py]"]
  node_inference_cli["Single-image Inference<br/>[inference.py]"]
  node_config["Model Configuration<br/>[config.py]"]
end

subgraph group_training["Model Training"]
  node_trainer["Training Workflow<br/>[training.py]"]
  node_preprocessing["Dataset Preparation"]
  node_architecture["Model Architecture<br/>[model.py]"]
  node_callbacks["Training Callbacks<br/>[callbacks.py]"]
  node_evaluation["Model Evaluation<br/>[evaluation.py]"]
  node_visualization["Training Visualization<br/>[visualization.py]"]
  node_examples["Dataset Examples<br/>[show_example.py]"]
end

subgraph group_interfaces["User Interfaces"]
  node_api_launcher["API Launcher<br/>[main_api.py]"]
  node_api["Prediction API<br/>[predict_api.py]"]
  node_schemas["Response Schemas<br/>[schemas.py]"]
  node_streamlit["Streamlit App<br/>[streamlit_app.py]"]
end

subgraph group_state["Data and Artifacts"]
  node_dataset["Training Data"]
  node_model_file["Saved Model"]
end

node_user(("Image User"))

node_api_launcher -->|"starts server"| node_api
node_user -->|"uploads images"| node_api
node_api -->|"runs inference"| node_predictor
node_api -->|"formats responses"| node_schemas
node_predictor -->|"loads model"| node_model_file
node_inference_cli -->|"predicts image"| node_predictor
node_inference_cli -->|"gets model path"| node_config
node_api -->|"uses settings"| node_config
node_predictor -->|"uses defaults"| node_config
node_trainer -->|"reads splits"| node_dataset
node_trainer -->|"builds datasets"| node_preprocessing
node_trainer -->|"builds model"| node_architecture
node_trainer -->|"gets callbacks"| node_callbacks
node_trainer -->|"evaluates predictions"| node_evaluation
node_trainer -->|"plots results"| node_visualization
node_trainer -->|"saves checkpoint"| node_model_file
node_examples -->|"uses preprocessing"| node_preprocessing
node_examples -->|"shows examples"| node_visualization
node_streamlit -.->|"serves interface"| node_user

click node_api_launcher "https://github.com/amedamsg/prjt_zonessattelites/blob/main/main_api.py"
click node_api "https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/api/predict_api.py"
click node_schemas "https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/api/schemas.py"
click node_streamlit "https://github.com/amedamsg/prjt_zonessattelites/blob/main/streamlit_app.py"
click node_predictor "https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/predictor/predictor.py"
click node_inference_cli "https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/predictor/inference.py"
click node_config "https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/config.py"
click node_trainer "https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/training.py"
click node_preprocessing "https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/data_preprocessing.py"
click node_architecture "https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/model.py"
click node_callbacks "https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/callbacks.py"
click node_evaluation "https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/evaluation.py"
click node_visualization "https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/visualization.py"
click node_examples "https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/show_example.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_predictor,node_inference_cli,node_config,node_user toneBlue
class node_trainer,node_preprocessing,node_architecture,node_callbacks,node_evaluation,node_visualization,node_examples toneAmber
class node_api_launcher,node_api,node_schemas,node_streamlit toneMint
class node_dataset,node_model_file toneRose
```

## Components

### Prediction Serving

- [Predictor](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/predictor/predictor.py): `src/predictor/predictor.py`
- [Single-image Inference](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/predictor/inference.py): `src/predictor/inference.py`
- [Model Configuration](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/config.py): `src/models/config.py`

### Model Training

- [Training Workflow](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/training.py): `src/models/training.py`
- [Dataset Preparation](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/data_preprocessing.py): `src/models/data_preprocessing.py`
- [Model Architecture](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/model.py): `src/models/model.py`
- [Training Callbacks](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/callbacks.py): `src/models/callbacks.py`
- [Model Evaluation](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/evaluation.py): `src/models/evaluation.py`
- [Training Visualization](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/visualization.py): `src/models/visualization.py`
- [Dataset Examples](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/models/show_example.py): `src/models/show_example.py`

### User Interfaces

- [API Launcher](https://github.com/amedamsg/prjt_zonessattelites/blob/main/main_api.py): `main_api.py`
- [Prediction API](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/api/predict_api.py): `src/api/predict_api.py`
- [Response Schemas](https://github.com/amedamsg/prjt_zonessattelites/blob/main/src/api/schemas.py): `src/api/schemas.py`
- [Streamlit App](https://github.com/amedamsg/prjt_zonessattelites/blob/main/streamlit_app.py): `streamlit_app.py`

### Data and Artifacts

- **Training Data**
- **Saved Model**

### Other components

- **Image User**

## Connections

- API Launcher → Prediction API: starts server (evidence: `main_api.py`)
- Image User → Prediction API: uploads images (evidence: `src/api/predict_api.py`)
- Prediction API → Predictor: runs inference (evidence: `src/api/predict_api.py`)
- Prediction API → Response Schemas: formats responses (evidence: `src/api/predict_api.py`)
- Predictor → Saved Model: loads model (evidence: `src/predictor/predictor.py`)
- Single-image Inference → Predictor: predicts image (evidence: `src/predictor/inference.py`)
- Single-image Inference → Model Configuration: gets model path (evidence: `src/predictor/inference.py`)
- Prediction API → Model Configuration: uses settings (evidence: `src/api/predict_api.py`)
- Predictor → Model Configuration: uses defaults (evidence: `src/predictor/predictor.py`)
- Training Workflow → Training Data: reads splits (evidence: `src/models/training.py`)
- Training Workflow → Dataset Preparation: builds datasets (evidence: `src/models/training.py`)
- Training Workflow → Model Architecture: builds model (evidence: `src/models/training.py`)
- Training Workflow → Training Callbacks: gets callbacks (evidence: `src/models/training.py`)
- Training Workflow → Model Evaluation: evaluates predictions (evidence: `src/models/training.py`)
- Training Workflow → Training Visualization: plots results (evidence: `src/models/training.py`)
- Training Workflow → Saved Model: saves checkpoint
- Dataset Examples → Dataset Preparation: uses preprocessing (evidence: `src/models/show_example.py`)
- Dataset Examples → Training Visualization: shows examples (evidence: `src/models/show_example.py`)
- Streamlit App → Image User: serves interface
