# abhinash2006/sih_proj architecture

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

- Interactive diagram: https://gitdiagram.com/abhinash2006/sih_proj
- Repository: https://github.com/abhinash2006/sih_proj

## Overview

Drone-VGGT turns drone video or image sequences into selected frames, metric 3D geometry, and disaster-response intelligence. The principal workflow proceeds from video preparation through geometry and depth validation to perception, spatial interpretation, incident handling, and rescue reporting. The repository also exposes an interactive Gradio dashboard and a CLI pipeline. The README documents several subsystem relationships whose implementation was not sampled; those are cited as documentation rather than presented as inspected call paths.

Main entry points: [`src/frame_selector.py`](https://github.com/abhinash2006/sih_proj/blob/main/src/frame_selector.py) (Frame Selection), [`src/reconstruction.py`](https://github.com/abhinash2006/sih_proj/blob/main/src/reconstruction.py) (Point Reconstruction), [`src/yolo_detector.py`](https://github.com/abhinash2006/sih_proj/blob/main/src/yolo_detector.py) (Object Detection), [`src/person_fusion.py`](https://github.com/abhinash2006/sih_proj/blob/main/src/person_fusion.py) (Person Fusion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Video Ingestion"]
  node_video["Video Processing<br/>[video_processor.py]"]
  node_frames["Frame Selection<br/>[frame_selector.py]"]
end

subgraph group_geometry["3D Reconstruction"]
  node_vggt["VGGT Inference<br/>[vggt_inference.py]"]
  node_depth["Monocular Depth"]
  node_depth_align["Depth Alignment<br/>[depth_alignment.py]"]
  node_depth_consistency["Depth Consistency"]
  node_depth_confidence["Depth Confidence"]
  node_reconstruction["Point Reconstruction<br/>[reconstruction.py]"]
  node_pc_filter["Point Cloud Filtering"]
  node_mesh["Mesh Generation<br/>[mesh_utils.py]"]
end

subgraph group_perception["Disaster Perception"]
  node_yolo["Object Detection<br/>[yolo_detector.py]"]
  node_aerial["Aerial Classification"]
  node_flood["Flood Analysis<br/>[flood_analyzer.py]"]
  node_segmentation["Water Segmentation<br/>[segmentation.py]"]
  node_damage["Damage Detection"]
  node_hazards["Hazard Detection"]
  node_tracking["Multi-frame Tracking<br/>[tracking.py]"]
end

subgraph group_rescue["Rescue Intelligence"]
  node_geo["3D Projection<br/>[geo_projection.py]"]
  node_point_lookup["3D Point Lookup<br/>[point_lookup.py]"]
  node_spatial["Spatial Context<br/>[spatial_context.py]"]
  node_person_fusion["Person Fusion<br/>[person_fusion.py]"]
  node_rescue_target["Rescue Targets<br/>[rescue_target.py]"]
  node_risk["Rescue Risk<br/>[rescue_risk.py]"]
  node_incident[("Incident Management")]
  node_report["Rescue Reports"]
end

subgraph group_delivery["User Interfaces"]
  node_dashboard["Gradio Dashboard<br/>[app.py]"]
  node_cli["Pipeline CLI<br/>[run_pipeline.py]"]
  node_outputs["3D Scene Outputs<br/>[output_manager.py]"]
end

node_responder(("Responder"))
node_drone_video["Drone Video"]

node_responder -->|"uses"| node_dashboard
node_drone_video -->|"provides footage"| node_video
node_dashboard -->|"prepares frames"| node_video
node_cli -->|"prepares frames"| node_video
node_video -->|"supplies candidates"| node_frames
node_frames -->|"infers geometry"| node_vggt
node_frames -->|"estimates depth"| node_depth
node_depth -->|"aligns depth"| node_depth_align
node_depth_align -->|"checks consistency"| node_depth_consistency
node_depth_consistency -->|"scores confidence"| node_depth_confidence
node_vggt -->|"builds point cloud"| node_reconstruction
node_depth_confidence -->|"gates points"| node_pc_filter
node_reconstruction -->|"filters points"| node_pc_filter
node_reconstruction -->|"generates mesh"| node_mesh
node_frames -->|"detects objects"| node_yolo
node_yolo -->|"tracks detections"| node_tracking
node_yolo -.->|"validates classes"| node_aerial
node_frames -.->|"analyzes flooding"| node_flood
node_flood -.->|"segments water"| node_segmentation
node_frames -->|"detects damage"| node_damage
node_frames -->|"detects hazards"| node_hazards
node_tracking -->|"projects detections"| node_geo
node_vggt -->|"provides point maps"| node_point_lookup
node_yolo -->|"provides detections"| node_point_lookup
node_flood -.->|"provides flood context"| node_spatial
node_geo -.->|"localizes targets"| node_person_fusion
node_spatial -.->|"adds context"| node_person_fusion
node_person_fusion -->|"validates targets"| node_rescue_target
node_person_fusion -->|"assesses priority"| node_risk
node_damage -->|"records incidents"| node_incident
node_hazards -->|"records incidents"| node_incident
node_risk -->|"informs priorities"| node_report
node_incident -.->|"supplies incidents"| node_report
node_reconstruction -.->|"exports scene"| node_outputs
node_rescue_target -->|"adds rescue markers"| node_outputs
node_dashboard -.->|"shows results"| node_outputs
node_cli -->|"writes results"| node_outputs
node_report -->|"delivers report"| node_responder

click node_dashboard "https://github.com/abhinash2006/sih_proj/blob/main/app.py"
click node_cli "https://github.com/abhinash2006/sih_proj/blob/main/scripts/run_pipeline.py"
click node_video "https://github.com/abhinash2006/sih_proj/blob/main/src/video_processor.py"
click node_frames "https://github.com/abhinash2006/sih_proj/blob/main/src/frame_selector.py"
click node_vggt "https://github.com/abhinash2006/sih_proj/blob/main/src/vggt_inference.py"
click node_depth "https://github.com/abhinash2006/sih_proj/blob/main/src/depth_anything_v2.py"
click node_depth_align "https://github.com/abhinash2006/sih_proj/blob/main/src/depth_alignment.py"
click node_depth_consistency "https://github.com/abhinash2006/sih_proj/blob/main/src/depth_consistency.py"
click node_depth_confidence "https://github.com/abhinash2006/sih_proj/blob/main/src/depth_confidence.py"
click node_reconstruction "https://github.com/abhinash2006/sih_proj/blob/main/src/reconstruction.py"
click node_pc_filter "https://github.com/abhinash2006/sih_proj/blob/main/src/pointcloud_filter.py"
click node_mesh "https://github.com/abhinash2006/sih_proj/blob/main/src/mesh_utils.py"
click node_yolo "https://github.com/abhinash2006/sih_proj/blob/main/src/yolo_detector.py"
click node_aerial "https://github.com/abhinash2006/sih_proj/blob/main/src/aerial_classifier.py"
click node_flood "https://github.com/abhinash2006/sih_proj/blob/main/src/flood_analyzer.py"
click node_segmentation "https://github.com/abhinash2006/sih_proj/blob/main/src/disaster_inspection/segmentation.py"
click node_damage "https://github.com/abhinash2006/sih_proj/blob/main/src/disaster_inspection/damage_detection.py"
click node_hazards "https://github.com/abhinash2006/sih_proj/blob/main/src/disaster_inspection/hazard_detection.py"
click node_tracking "https://github.com/abhinash2006/sih_proj/blob/main/src/disaster_inspection/tracking.py"
click node_geo "https://github.com/abhinash2006/sih_proj/blob/main/src/disaster_inspection/geo_projection.py"
click node_point_lookup "https://github.com/abhinash2006/sih_proj/blob/main/src/point_lookup.py"
click node_spatial "https://github.com/abhinash2006/sih_proj/blob/main/src/spatial_context.py"
click node_person_fusion "https://github.com/abhinash2006/sih_proj/blob/main/src/person_fusion.py"
click node_rescue_target "https://github.com/abhinash2006/sih_proj/blob/main/src/rescue_target.py"
click node_risk "https://github.com/abhinash2006/sih_proj/blob/main/src/rescue_risk.py"
click node_incident "https://github.com/abhinash2006/sih_proj/blob/main/src/disaster_inspection/incident_manager.py"
click node_report "https://github.com/abhinash2006/sih_proj/blob/main/src/disaster_inspection/report_generator.py"
click node_outputs "https://github.com/abhinash2006/sih_proj/blob/main/src/output/output_manager.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_video,node_frames toneBlue
class node_vggt,node_depth,node_depth_align,node_depth_consistency,node_depth_confidence,node_reconstruction,node_pc_filter,node_mesh toneAmber
class node_yolo,node_aerial,node_flood,node_segmentation,node_damage,node_hazards,node_tracking toneMint
class node_geo,node_point_lookup,node_spatial,node_person_fusion,node_rescue_target,node_risk,node_incident,node_report toneRose
class node_dashboard,node_cli,node_outputs,node_responder,node_drone_video toneIndigo
```

## Components

### Video Ingestion

- [Video Processing](https://github.com/abhinash2006/sih_proj/blob/main/src/video_processor.py): `src/video_processor.py`
- [Frame Selection](https://github.com/abhinash2006/sih_proj/blob/main/src/frame_selector.py): `src/frame_selector.py`

### 3D Reconstruction

- [VGGT Inference](https://github.com/abhinash2006/sih_proj/blob/main/src/vggt_inference.py): `src/vggt_inference.py`
- [Monocular Depth](https://github.com/abhinash2006/sih_proj/blob/main/src/depth_anything_v2.py): `src/depth_anything_v2.py`
- [Depth Alignment](https://github.com/abhinash2006/sih_proj/blob/main/src/depth_alignment.py): `src/depth_alignment.py`
- [Depth Consistency](https://github.com/abhinash2006/sih_proj/blob/main/src/depth_consistency.py): `src/depth_consistency.py`
- [Depth Confidence](https://github.com/abhinash2006/sih_proj/blob/main/src/depth_confidence.py): `src/depth_confidence.py`
- [Point Reconstruction](https://github.com/abhinash2006/sih_proj/blob/main/src/reconstruction.py): `src/reconstruction.py`
- [Point Cloud Filtering](https://github.com/abhinash2006/sih_proj/blob/main/src/pointcloud_filter.py): `src/pointcloud_filter.py`
- [Mesh Generation](https://github.com/abhinash2006/sih_proj/blob/main/src/mesh_utils.py): `src/mesh_utils.py`

### Disaster Perception

- [Object Detection](https://github.com/abhinash2006/sih_proj/blob/main/src/yolo_detector.py): `src/yolo_detector.py`
- [Aerial Classification](https://github.com/abhinash2006/sih_proj/blob/main/src/aerial_classifier.py): `src/aerial_classifier.py`
- [Flood Analysis](https://github.com/abhinash2006/sih_proj/blob/main/src/flood_analyzer.py): `src/flood_analyzer.py`
- [Water Segmentation](https://github.com/abhinash2006/sih_proj/blob/main/src/disaster_inspection/segmentation.py): `src/disaster_inspection/segmentation.py`
- [Damage Detection](https://github.com/abhinash2006/sih_proj/blob/main/src/disaster_inspection/damage_detection.py): `src/disaster_inspection/damage_detection.py`
- [Hazard Detection](https://github.com/abhinash2006/sih_proj/blob/main/src/disaster_inspection/hazard_detection.py): `src/disaster_inspection/hazard_detection.py`
- [Multi-frame Tracking](https://github.com/abhinash2006/sih_proj/blob/main/src/disaster_inspection/tracking.py): `src/disaster_inspection/tracking.py`

### Rescue Intelligence

- [3D Projection](https://github.com/abhinash2006/sih_proj/blob/main/src/disaster_inspection/geo_projection.py): `src/disaster_inspection/geo_projection.py`
- [3D Point Lookup](https://github.com/abhinash2006/sih_proj/blob/main/src/point_lookup.py): `src/point_lookup.py`
- [Spatial Context](https://github.com/abhinash2006/sih_proj/blob/main/src/spatial_context.py): `src/spatial_context.py`
- [Person Fusion](https://github.com/abhinash2006/sih_proj/blob/main/src/person_fusion.py): `src/person_fusion.py`
- [Rescue Targets](https://github.com/abhinash2006/sih_proj/blob/main/src/rescue_target.py): `src/rescue_target.py`
- [Rescue Risk](https://github.com/abhinash2006/sih_proj/blob/main/src/rescue_risk.py): `src/rescue_risk.py`
- [Incident Management](https://github.com/abhinash2006/sih_proj/blob/main/src/disaster_inspection/incident_manager.py): `src/disaster_inspection/incident_manager.py`
- [Rescue Reports](https://github.com/abhinash2006/sih_proj/blob/main/src/disaster_inspection/report_generator.py): `src/disaster_inspection/report_generator.py`

### User Interfaces

- [Gradio Dashboard](https://github.com/abhinash2006/sih_proj/blob/main/app.py): `app.py`
- [Pipeline CLI](https://github.com/abhinash2006/sih_proj/blob/main/scripts/run_pipeline.py): `scripts/run_pipeline.py`
- [3D Scene Outputs](https://github.com/abhinash2006/sih_proj/blob/main/src/output/output_manager.py): `src/output/output_manager.py`

### Other components

- **Responder**
- **Drone Video**

## Connections

- Responder → Gradio Dashboard: uses
- Drone Video → Video Processing: provides footage
- Gradio Dashboard → Video Processing: prepares frames (evidence: `app.py`)
- Pipeline CLI → Video Processing: prepares frames (evidence: `scripts/run_pipeline.py`)
- Video Processing → Frame Selection: supplies candidates
- Frame Selection → VGGT Inference: infers geometry
- Frame Selection → Monocular Depth: estimates depth
- Monocular Depth → Depth Alignment: aligns depth
- Depth Alignment → Depth Consistency: checks consistency
- Depth Consistency → Depth Confidence: scores confidence
- VGGT Inference → Point Reconstruction: builds point cloud
- Depth Confidence → Point Cloud Filtering: gates points
- Point Reconstruction → Point Cloud Filtering: filters points
- Point Reconstruction → Mesh Generation: generates mesh
- Frame Selection → Object Detection: detects objects
- Object Detection → Multi-frame Tracking: tracks detections
- Object Detection → Aerial Classification: validates classes
- Frame Selection → Flood Analysis: analyzes flooding
- Flood Analysis → Water Segmentation: segments water (evidence: `src/disaster_inspection/segmentation.py`)
- Frame Selection → Damage Detection: detects damage
- Frame Selection → Hazard Detection: detects hazards
- Multi-frame Tracking → 3D Projection: projects detections
- VGGT Inference → 3D Point Lookup: provides point maps (evidence: `app.py`)
- Object Detection → 3D Point Lookup: provides detections (evidence: `app.py`)
- Flood Analysis → Spatial Context: provides flood context
- 3D Projection → Person Fusion: localizes targets
- Spatial Context → Person Fusion: adds context
- Person Fusion → Rescue Targets: validates targets (evidence: `src/person_fusion.py`)
- Person Fusion → Rescue Risk: assesses priority (evidence: `src/person_fusion.py`)
- Damage Detection → Incident Management: records incidents
- Hazard Detection → Incident Management: records incidents
- Rescue Risk → Rescue Reports: informs priorities
- Incident Management → Rescue Reports: supplies incidents
- Point Reconstruction → 3D Scene Outputs: exports scene
- Rescue Targets → 3D Scene Outputs: adds rescue markers
- Gradio Dashboard → 3D Scene Outputs: shows results
- Pipeline CLI → 3D Scene Outputs: writes results (evidence: `scripts/run_pipeline.py`)
- Rescue Reports → Responder: delivers report
