# abhay-bits/geo-visualization architecture

> Architecture diagram of the GitHub repository abhay-bits/geo-visualization, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhay-bits/geo-visualization
- Repository: https://github.com/abhay-bits/geo-visualization

## Overview

##### Project type and purpose
- This is a full-stack, streaming visualization application.
- Purpose: capture depth+video from an Intel RealSense camera, compute head pose (MediaPipe FaceMesh), and use that data via WebSocket to manipulate a CesiumJS 3D scene (Mount Fuji).

##### File structure
- Top-level “Cesium Sand Castle Example – Mt. Fuji” contains the static frontend (index.html, script.js).
- “For Getting the Face data” holds three Python scripts:
- VideoGetHD.py – captures HD video + depth frames via pyrealsense2
- FaceTracker.py – runs MediaPipe FaceMesh, extracts head orientation
- VirtualWindow.py – (optionally) renders a local preview window
- No explicit WebSocket server code file name, but script.js references a WebSocket endpoint, so one of the Python scripts or a separate process must host a WebSocket server.

##### README for additional insights
- Dependencies: CesiumJS (frontend), MediaPipe FaceMesh (Python), Intel RealSense SDK + pyrealsense2 (Python).
- Data flow: RealSense depth & video → Python processing → WebSocket → CesiumJS viewer.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Hardware
    Camera["RealSense Camera"]:::hardware
    %% Backend Modules
    subgraph "Backend Pipeline"
        direction TB
        VideoGetHD["VideoGetHD.py\n(Depth + Video Capture)"]:::backend
        FaceTracker["FaceTracker.py\n(Head Pose Computation & WebSocket Server)"]:::backend
        VirtualWindow["VirtualWindow.py\n(Optional Local Preview)"]:::backend
    end
    %% Network Boundary
    WSClient["WebSocket Connection\n(TCP)"]:::network
    %% Frontend Modules
    subgraph "Frontend"
        direction TB
        Browser["Browser\n(WebSocket Client)"]:::frontend
        CesiumViewer["CesiumJS Viewer\n(Mt. Fuji Scene)"]:::frontend
    end

    %% Data Flows
    Camera -->|Captures frames| VideoGetHD
    VideoGetHD -->|Sends video frames| FaceTracker
    VideoGetHD -->|Streams preview| VirtualWindow
    FaceTracker -->|Publishes head pose JSON| WSClient
    WSClient <-->|WebSocket API| Browser
    Browser -->|Updates camera orientation| CesiumViewer

    %% Click Events
    click VideoGetHD "https://github.com/abhay-bits/geo-visualization/blob/main/For Getting the Face data/VideoGetHD.py"
    click FaceTracker "https://github.com/abhay-bits/geo-visualization/blob/main/For Getting the Face data/FaceTracker.py"
    click VirtualWindow "https://github.com/abhay-bits/geo-visualization/blob/main/For Getting the Face data/VirtualWindow.py"
    click Browser "https://github.com/abhay-bits/geo-visualization/blob/main/Cesium Sand Castle Example - Mt. Fuji/index.html"
    click CesiumViewer "https://github.com/abhay-bits/geo-visualization/blob/main/Cesium Sand Castle Example - Mt. Fuji/script.js"
    click README "https://github.com/abhay-bits/geo-visualization/blob/main/README.md"
    click LICENSE "https://github.com/abhay-bits/geo-visualization/tree/main/LICENSE"

    %% Legend
    subgraph "Legend"
        direction TB
        HW["Hardware"]:::hardware
        BE["Backend Modules"]:::backend
        NW["Network Boundary"]:::network
        FE["Frontend Modules"]:::frontend
    end

    %% Styles
    classDef hardware fill:#d3d3d3,stroke:#333,color:#000
    classDef backend fill:#add8e6,stroke:#333,color:#000
    classDef frontend fill:#90ee90,stroke:#333,color:#000
    classDef network fill:#ffe4b5,stroke:#333,color:#000
```
