irn-engine 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- irn_engine-0.1.0/PKG-INFO +375 -0
- irn_engine-0.1.0/PLAN.md +350 -0
- irn_engine-0.1.0/README.md +348 -0
- irn_engine-0.1.0/irn/__init__.py +3 -0
- irn_engine-0.1.0/irn/cli.py +406 -0
- irn_engine-0.1.0/irn/common/crs.py +148 -0
- irn_engine-0.1.0/irn/common/io.py +40 -0
- irn_engine-0.1.0/irn/common/logger.py +58 -0
- irn_engine-0.1.0/irn/common/metrics.py +84 -0
- irn_engine-0.1.0/irn/m1_fetcher/__init__.py +6 -0
- irn_engine-0.1.0/irn/m1_fetcher/cleaner.py +230 -0
- irn_engine-0.1.0/irn/m1_fetcher/osm_fetcher.py +271 -0
- irn_engine-0.1.0/irn/m2_cv_interface/__init__.py +20 -0
- irn_engine-0.1.0/irn/m2_cv_interface/detector.py +196 -0
- irn_engine-0.1.0/irn/m2_cv_interface/idd_adapter.py +306 -0
- irn_engine-0.1.0/irn/m2_cv_interface/schema.py +177 -0
- irn_engine-0.1.0/irn/m3_fusion/__init__.py +44 -0
- irn_engine-0.1.0/irn/m3_fusion/camera_model.py +246 -0
- irn_engine-0.1.0/irn/m3_fusion/deduplication.py +247 -0
- irn_engine-0.1.0/irn/m3_fusion/linear_ref.py +99 -0
- irn_engine-0.1.0/irn/m3_fusion/map_matcher.py +327 -0
- irn_engine-0.1.0/irn/m3_fusion/pipeline.py +167 -0
- irn_engine-0.1.0/irn/m3_fusion/storage.py +232 -0
- irn_engine-0.1.0/irn/m3_fusion/sync.py +144 -0
- irn_engine-0.1.0/irn/m3_fusion/width_fusion.py +83 -0
- irn_engine-0.1.0/irn/m4_compiler/__init__.py +19 -0
- irn_engine-0.1.0/irn/m4_compiler/anomalies_generator.py +66 -0
- irn_engine-0.1.0/irn/m4_compiler/compiler.py +148 -0
- irn_engine-0.1.0/irn/m4_compiler/netconvert_runner.py +112 -0
- irn_engine-0.1.0/irn/m4_compiler/sumo_config_generator.py +67 -0
- irn_engine-0.1.0/irn/m4_compiler/sumo_plain_xml.py +127 -0
- irn_engine-0.1.0/irn/m4_compiler/validator.py +104 -0
- irn_engine-0.1.0/irn/m4_compiler/vtypes_generator.py +134 -0
- irn_engine-0.1.0/irn/m4_compiler/xodr_builder.py +139 -0
- irn_engine-0.1.0/irn/orchestrator.py +480 -0
- irn_engine-0.1.0/irn_engine.egg-info/PKG-INFO +375 -0
- irn_engine-0.1.0/irn_engine.egg-info/SOURCES.txt +47 -0
- irn_engine-0.1.0/irn_engine.egg-info/dependency_links.txt +1 -0
- irn_engine-0.1.0/irn_engine.egg-info/entry_points.txt +2 -0
- irn_engine-0.1.0/irn_engine.egg-info/requires.txt +21 -0
- irn_engine-0.1.0/irn_engine.egg-info/top_level.txt +1 -0
- irn_engine-0.1.0/pyproject.toml +49 -0
- irn_engine-0.1.0/setup.cfg +4 -0
- irn_engine-0.1.0/tests/test_compiler.py +166 -0
- irn_engine-0.1.0/tests/test_deduplication.py +110 -0
- irn_engine-0.1.0/tests/test_end_to_end.py +71 -0
- irn_engine-0.1.0/tests/test_m1_m2_core.py +194 -0
- irn_engine-0.1.0/tests/test_map_matcher.py +82 -0
- irn_engine-0.1.0/tests/test_projection.py +127 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: irn-engine
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Automated Road Network Modeling Engine for Lane-Free Indian Traffic Simulations
|
|
5
|
+
Author-email: Yash Pouranik <yash@example.com>, Yashika Goswami <yashika@example.com>, Vipul Yadav <vipul@example.com>, Vivek Tekwani <vivek@example.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: numpy>=1.24
|
|
10
|
+
Requires-Dist: scipy>=1.10
|
|
11
|
+
Requires-Dist: pandas>=2.0
|
|
12
|
+
Requires-Dist: pyarrow>=14.0
|
|
13
|
+
Requires-Dist: pydantic>=2.0
|
|
14
|
+
Requires-Dist: shapely>=2.0
|
|
15
|
+
Requires-Dist: pyproj>=3.5
|
|
16
|
+
Requires-Dist: typer>=0.9.0
|
|
17
|
+
Requires-Dist: pyyaml>=6.0
|
|
18
|
+
Provides-Extra: geo
|
|
19
|
+
Requires-Dist: geopandas>=0.14; extra == "geo"
|
|
20
|
+
Requires-Dist: osmnx>=2.0; extra == "geo"
|
|
21
|
+
Provides-Extra: cv
|
|
22
|
+
Requires-Dist: opencv-python-headless>=4.8; extra == "cv"
|
|
23
|
+
Requires-Dist: ultralytics>=8.0; extra == "cv"
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
26
|
+
Requires-Dist: lxml>=4.9; extra == "dev"
|
|
27
|
+
|
|
28
|
+
# IRN Engine (`irn`)
|
|
29
|
+
### Automated Road Network Modeling Engine for Lane-Free Indian Traffic Simulations
|
|
30
|
+
|
|
31
|
+
[](https://www.python.org/)
|
|
32
|
+
[](https://opensource.org/licenses/MIT)
|
|
33
|
+
[-green.svg)]()
|
|
34
|
+
[]()
|
|
35
|
+
[]()
|
|
36
|
+
|
|
37
|
+
> **B.Tech CSE Major Project (2026–27)**
|
|
38
|
+
> **Department of Computer Science & Engineering**
|
|
39
|
+
> **Shri Vaishnav Institute of Information Technology (SVIIT), SVVV, Indore**
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 1. Overview & Problem Statement
|
|
44
|
+
|
|
45
|
+
Standard microscopic traffic simulators (Eclipse SUMO, CARLA) and autonomous driving models inherently assume **lane-disciplined, homogeneous traffic** operating on uniformly marked roads.
|
|
46
|
+
|
|
47
|
+
Indian urban traffic fundamentally breaks these assumptions:
|
|
48
|
+
- **Heterogeneous Traffic Mix:** Roads are shared by two-wheelers, auto-rickshaws, cars, commercial buses, trucks, cycle rickshaws, pedestrians, and stray animals.
|
|
49
|
+
- **Lane-Free Lateral Dynamics:** Vehicles navigate opportunistically without following painted lane boundaries, packing tightly into lateral gaps.
|
|
50
|
+
- **Unmapped Physical Anomalies:** Potholes, unstandardized speed breakers, barricades, and parked vehicle obstructions actively constrain vehicle trajectories and speed profiles.
|
|
51
|
+
|
|
52
|
+
**IRN Engine** is a high-performance Python data pipeline that bridges this gap. It ingests static road networks from **OpenStreetMap (OSM)**, fuses localized obstacle detections from the **IIIT-Hyderabad Indian Driving Dataset (IDD Multimodal)** using rigorous mathematical geospatial fusion, and compiles simulation-ready networks for **Eclipse SUMO (Sublane Model)** and **ASAM OpenDRIVE (`.xodr`)**.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 2. Pipeline Architecture
|
|
57
|
+
|
|
58
|
+
The engine is structured around four decoupled modules communicating strictly via validated **Data Contracts**:
|
|
59
|
+
|
|
60
|
+
```mermaid
|
|
61
|
+
flowchart TD
|
|
62
|
+
OSM[OpenStreetMap Overpass API] -->|BBox / Place Query| M1[M1: Map Fetcher\nOSMnx + UTM Projection]
|
|
63
|
+
M1 -->|Contract D1| D1[(D1: edges.gpkg\nnodes.gpkg\nosm_snapshot.json)]
|
|
64
|
+
|
|
65
|
+
IDD[IDD Video Frames & GPS] -->|Calibrated Rig| M2[M2: CV Layer\nYOLOv8 + ByteTrack]
|
|
66
|
+
M2 -->|Contract D2| D2[(D2: detections.parquet)]
|
|
67
|
+
|
|
68
|
+
D1 --> M3[M3: Geospatial Data Fusion\nRay Cast + HMM Viterbi + Mahalanobis]
|
|
69
|
+
D2 --> M3
|
|
70
|
+
GPS[Vehicle GPS CSV] --> M3
|
|
71
|
+
RIG[configs/rig.yaml] --> M3
|
|
72
|
+
|
|
73
|
+
M3 -->|Contract D3| D3[(D3: anomalies.db SQLite)]
|
|
74
|
+
M3 -->|Contract D4| D4[(D4: enriched_edges.parquet\nanomalies.parquet)]
|
|
75
|
+
|
|
76
|
+
D4 --> M4[M4: Simulation Compiler\nPlain-XML + netconvert + OpenDRIVE]
|
|
77
|
+
M4 --> OUT[Simulation Scenario Bundle\n- network.net.xml LHT\n- network.xodr 1.6.1\n- vtypes.add.xml Sublane\n- anomalies.add.xml\n- scenario.sumocfg\n- preview.geojson]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Module Breakdown & Team Ownership
|
|
81
|
+
|
|
82
|
+
| Module | Lead | Responsibilities & Scope | Tech Stack |
|
|
83
|
+
| :--- | :--- | :--- | :--- |
|
|
84
|
+
| **M1: Map Fetcher** | **Yashika Goswami** | OSM acquisition via BBox/place query, rate-limit backoff, attribute normalization (lanes, speed, width), UTM projection, zero-length pruning, Contract D1 export. | `osmnx >= 2.0`, `geopandas`, `shapely`, `pyproj` |
|
|
85
|
+
| **M2: CV Layer** | **Vipul Yadav** | IDD Multimodal dataset ingestion, YOLOv8 inference for Indian road obstacles/agents, ByteTrack tracking, bottom-center ground contact projection, Contract D2 Parquet export. | `ultralytics`, `pyarrow`, `pydantic`, `opencv-python` |
|
|
86
|
+
| **M3: Geospatial Fusion** | **Yash Pouranik** *(Core)* | Ground-plane ray intersection ($z = -h$), temporal GPS sync, cKDTree candidate filtering, HMM Viterbi map matching, relative linear referencing $(s, t)$, 2-level Mahalanobis de-duplication. | `numpy`, `scipy`, `shapely 2.0`, `pyproj`, `sqlite3` |
|
|
87
|
+
| **M4: Simulation Compiler** | **Vivek Tekwani** | SUMO Plain-XML generation (`.nod.xml`, `.edg.xml`), `netconvert` compilation with `--lefthand=true`, Indian vehicle types with arbitrary lateral alignment, ASAM OpenDRIVE 1.6.1 `.xodr` generation. | `lxml`, `sumo-tools`, Eclipse SUMO `>= 1.18` |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 3. Data Contracts
|
|
92
|
+
|
|
93
|
+
All modules communicate strictly through validated, versioned disk artifacts:
|
|
94
|
+
|
|
95
|
+
| Contract | Path | Format | Description |
|
|
96
|
+
| :--- | :--- | :--- | :--- |
|
|
97
|
+
| **D1: Road Graph** | `data/d1_graph/` | GeoPackage (`.gpkg`) + JSON | Cleaned drivable road network (`edges.gpkg`, `nodes.gpkg`, `osm_snapshot.json`) with WGS84 coordinates and local UTM projections. |
|
|
98
|
+
| **D2: CV Detections** | `data/d2_detections/` | Apache Parquet (`.parquet`) | Structured obstacle detections (`sequence_id`, `frame_idx`, `frame_ts`, `class_name`, `conf`, `u`, `v`, `track_id`). |
|
|
99
|
+
| **D3: Anomaly Ledger** | `data/d3_store/` | SQLite (`anomalies.db`) | Append-only observation log and canonical anomaly lifecycle tracker (`CANDIDATE` $\to$ `CONFIRMED` $\to$ `RESOLVED`). |
|
|
100
|
+
| **D4: Enriched Graph** | `data/d4_enriched/` | Apache Parquet | `enriched_edges.parquet` and `anomalies.parquet` with linear referencing offsets $(s, t)$ and lateral positioning. |
|
|
101
|
+
| **Output Scenario** | `output_scenario/` | XML + XODR + GeoJSON | SUMO `.net.xml`, `.xodr`, `.sumocfg`, vehicle profiles (`vtypes.add.xml`), obstacle zones (`anomalies.add.xml`), and `preview.geojson`. |
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 4. Getting Started & Setup Guide
|
|
106
|
+
|
|
107
|
+
### 4.1 Prerequisites
|
|
108
|
+
|
|
109
|
+
- **Python:** 3.10, 3.11, 3.12, or 3.13
|
|
110
|
+
- **Operating System:** Windows 10/11, Ubuntu 20.04+, or macOS
|
|
111
|
+
- **Optional Tools:**
|
|
112
|
+
- [Eclipse SUMO](https://eclipse.dev/sumo/) ($\ge 1.18$) for running microscopic simulations and SUMO-GUI.
|
|
113
|
+
- [QGIS](https://qgis.org/) for visualizing generated GeoPackages and GeoJSON layers.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### 4.2 Clone & Environment Setup
|
|
118
|
+
|
|
119
|
+
#### Option A: Windows (PowerShell)
|
|
120
|
+
```powershell
|
|
121
|
+
# 1. Clone repository
|
|
122
|
+
git clone https://github.com/yash-pouranik/irn-engine.git
|
|
123
|
+
cd irn-engine
|
|
124
|
+
|
|
125
|
+
# 2. Create virtual environment
|
|
126
|
+
python -m venv .venv
|
|
127
|
+
|
|
128
|
+
# 3. Activate virtual environment
|
|
129
|
+
.venv\Scripts\Activate.ps1
|
|
130
|
+
|
|
131
|
+
# 4. Upgrade pip & build tools
|
|
132
|
+
python -m pip install --upgrade pip setuptools wheel
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
> **Note (PowerShell Execution Policy):** If script activation fails with an execution policy error, run:
|
|
136
|
+
> ```powershell
|
|
137
|
+
> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
|
|
138
|
+
> ```
|
|
139
|
+
|
|
140
|
+
#### Option B: Linux / macOS (Bash / Zsh)
|
|
141
|
+
```bash
|
|
142
|
+
# 1. Clone repository
|
|
143
|
+
git clone https://github.com/yash-pouranik/irn-engine.git
|
|
144
|
+
cd irn-engine
|
|
145
|
+
|
|
146
|
+
# 2. Create virtual environment
|
|
147
|
+
python3 -m venv .venv
|
|
148
|
+
|
|
149
|
+
# 3. Activate virtual environment
|
|
150
|
+
source .venv/bin/activate
|
|
151
|
+
|
|
152
|
+
# 4. Upgrade pip & build tools
|
|
153
|
+
pip install --upgrade pip setuptools wheel
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
### 4.3 Install Dependencies
|
|
159
|
+
|
|
160
|
+
Install the core pipeline in editable mode:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Install core pipeline
|
|
164
|
+
pip install -e .
|
|
165
|
+
|
|
166
|
+
# Install optional geospatial, CV, and development tools
|
|
167
|
+
pip install -e ".[geo,cv,dev]"
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Verify your installation:
|
|
171
|
+
```bash
|
|
172
|
+
irn info
|
|
173
|
+
# Or run as a module:
|
|
174
|
+
python -m irn.cli info
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Expected output:
|
|
178
|
+
```text
|
|
179
|
+
=================================================================
|
|
180
|
+
IRN: Road Network Modeling Engine (SVIIT Indore Major Project)
|
|
181
|
+
=================================================================
|
|
182
|
+
OSMnx Version: 2.1.1
|
|
183
|
+
Shapely Version: 2.2.0
|
|
184
|
+
PyArrow Version: 25.0.1
|
|
185
|
+
Traffic Rule: Strict Left-Hand Traffic (LHT)
|
|
186
|
+
Coordinate Grid: WGS84 Storage (EPSG:4326) / Local Projected UTM
|
|
187
|
+
=================================================================
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 5. Usage & CLI Workflow
|
|
193
|
+
|
|
194
|
+
The pipeline is controlled via the `irn` command-line interface.
|
|
195
|
+
|
|
196
|
+
### 5.1 Generate Synthetic Ground Truth World
|
|
197
|
+
To verify mathematical formulas without downloading external maps or videos, generate the synthetic test world:
|
|
198
|
+
```bash
|
|
199
|
+
irn synth --out data/synthetic --length 150.0
|
|
200
|
+
```
|
|
201
|
+
This generates:
|
|
202
|
+
- `data/synthetic/d1_graph/edges.gpkg` (Synthetic dual-carriageway road)
|
|
203
|
+
- `data/synthetic/d1_graph/nodes.gpkg`
|
|
204
|
+
- `data/synthetic/d2_data/detections.parquet` (Planted potholes & speed breakers)
|
|
205
|
+
- `data/synthetic/d2_data/gps_trajectory.csv` (Simulated vehicle trajectory)
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
### 5.2 Fetch Road Graph from OpenStreetMap (Module 1)
|
|
210
|
+
|
|
211
|
+
#### Option 1: Live Download via Bounding Box
|
|
212
|
+
Fetches drivable network, projects to the optimal local UTM zone, parses Indian road attributes, and exports Contract D1:
|
|
213
|
+
```bash
|
|
214
|
+
# Example: IIIT-Hyderabad / Gachibowli Corridor (west, south, east, north)
|
|
215
|
+
irn fetch --bbox "78.3400,17.4350,78.3650,17.4550" --out data/d1_graph
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
#### Option 2: Live Download via Place Name
|
|
219
|
+
```bash
|
|
220
|
+
irn fetch --place "Gachibowli, Hyderabad, India" --out data/d1_graph
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
#### Option 3: Offline Mode (No Internet Required)
|
|
224
|
+
Generates a calibrated geometric grid for testing without calling the Overpass API:
|
|
225
|
+
```bash
|
|
226
|
+
irn fetch --offline --out data/d1_graph
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
### 5.3 Generate / Ingest Obstacle Detections (Module 2)
|
|
232
|
+
Generate schema-validated detections in Apache Parquet format:
|
|
233
|
+
```bash
|
|
234
|
+
irn detect --seq seq_demo_01 --frames 120 --out data/d2_detections/detections.parquet
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
### 5.4 Execute Geospatial Data Fusion (Module 3)
|
|
240
|
+
Execute 3D ground-plane ray projection, GPS alignment, HMM Viterbi map matching, relative linear referencing $(s, t)$, and Mahalanobis de-duplication:
|
|
241
|
+
```bash
|
|
242
|
+
irn fuse --graph data/synthetic/d1_graph/edges.gpkg --detections data/synthetic/d2_data/detections.parquet --gps data/synthetic/d2_data/gps.csv
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
### 5.5 Compile Simulation Scenario (Module 4)
|
|
248
|
+
Compile enriched road network into Eclipse SUMO (Sublane model) and ASAM OpenDRIVE 1.6.1:
|
|
249
|
+
```bash
|
|
250
|
+
irn compile --enriched data/d4_enriched/enriched_edges.parquet --anomalies data/d4_enriched/anomalies.parquet --nodes data/synthetic/d1_graph/nodes.gpkg --out output_scenario
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
### 5.6 CLI Command Reference
|
|
256
|
+
|
|
257
|
+
| Command | Arguments / Flags | Description |
|
|
258
|
+
| :--- | :--- | :--- |
|
|
259
|
+
| `irn info` | None | Displays engine versions, active CRS projection, and convention flags. |
|
|
260
|
+
| `irn fetch` | `--bbox <W,S,E,N>`<br>`--place <STR>`<br>`--out <DIR>`<br>`--timeout <SEC>`<br>`--offline` | Ingests drivable OSM network, cleans attributes, normalizes lanes/widths, and saves D1 GeoPackage. |
|
|
261
|
+
| `irn detect` | `--seq <NAME>`<br>`--frames <INT>`<br>`--out <FILE>` | Runs detection pipeline / mock generator and writes Contract D2 Parquet. |
|
|
262
|
+
| `irn synth` | `--out <DIR>`<br>`--length <METERS>` | Builds a mathematically controlled ground-truth corridor for unit/regression testing. |
|
|
263
|
+
| `irn fuse` | `--graph <PATH>`<br>`--detections <PATH>`<br>`--gps <PATH>`<br>`--rig <PATH>` | Executes M3 Ray casting, HMM map matching, and multi-pass anomaly clustering. |
|
|
264
|
+
| `irn compile` | `--enriched <PATH>`<br>`--anomalies <PATH>`<br>`--nodes <PATH>`<br>`--out <DIR>` | Compiles Plain-XML $\to$ SUMO `.net.xml` and ASAM OpenDRIVE `.xodr` scenario. |
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## 6. Configuration Management
|
|
269
|
+
|
|
270
|
+
Zero magic numbers are permitted in the codebase. All operational parameters are maintained in `configs/`:
|
|
271
|
+
|
|
272
|
+
### `configs/run_config.yaml`
|
|
273
|
+
- **Traffic Conventions:** Left-Hand Traffic (`LHT`).
|
|
274
|
+
- **M1 Fetcher:** Target Bounding Box, Overpass timeout, user-agent.
|
|
275
|
+
- **M2 CV:** Confidence thresholds ($0.25$ candidate extraction), class taxonomy.
|
|
276
|
+
- **M3 Fusion:** GPS max temporal delta ($dt \le 0.2\,\text{s}$), HMM search radius ($35\,\text{m}$), HMM bearing angle gate ($100^\circ$), Mahalanobis Chi-square gate ($\chi^2 = 9.21, p=0.01$).
|
|
277
|
+
- **M4 Compiler:** `lanefree_mode: "collapse"`, sublane lateral resolution ($0.6\,\text{m}$), step length ($0.1\,\text{s}$).
|
|
278
|
+
|
|
279
|
+
### `configs/rig.yaml`
|
|
280
|
+
- **Camera Intrinsics:** $f_x, f_y, c_x, c_y$ calibrated for IDD front-facing camera.
|
|
281
|
+
- **Extrinsics & Mounting:** Camera height $h = 1.5\,\text{m}$, downward pitch $\theta = -2.5^\circ$, roll/yaw offsets.
|
|
282
|
+
- **Processing Gates:** Ground range gate $[4.0\,\text{m}, 30.0\,\text{m}]$, ray projection covariance gates.
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## 7. Running Tests
|
|
287
|
+
|
|
288
|
+
Run the complete test suite with `pytest`:
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Run all tests
|
|
292
|
+
pytest
|
|
293
|
+
|
|
294
|
+
# Run tests with verbose output
|
|
295
|
+
pytest -v
|
|
296
|
+
|
|
297
|
+
# Run tests with execution timing
|
|
298
|
+
pytest -v --durations=5
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### What is Tested:
|
|
302
|
+
1. **Rule G-1 (Coordinate Round-Trip Precision):** Asserts sub-millimeter conversion accuracy between WGS84 (`EPSG:4326`) and local UTM projections (Zone 43N/44N).
|
|
303
|
+
2. **M1 Attribute Cleaner:** Asserts parsing of non-standard OSM tags (`lanes`, `maxspeed`, `width`) and zero-length edge pruning.
|
|
304
|
+
3. **M2 Schema & Ground Contact:** Asserts bottom-center $(u, v)$ calculation and Parquet round-trip serialization.
|
|
305
|
+
4. **Synthetic World Fixture:** Validates deterministic graph generation and planted anomaly recovery.
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## 8. Repository Structure
|
|
310
|
+
|
|
311
|
+
```text
|
|
312
|
+
irn-engine/
|
|
313
|
+
├── configs/ # Configuration parameters (zero magic numbers)
|
|
314
|
+
│ ├── rig.yaml # Camera intrinsics, mounting height, pitch, range gates
|
|
315
|
+
│ └── run_config.yaml # Pipeline run config, thresholds, and SUMO sublane parameters
|
|
316
|
+
├── data/ # Runtime data artifacts (git-ignored except sample fixtures)
|
|
317
|
+
│ ├── d1_graph/ # Contract D1: edges.gpkg, nodes.gpkg, osm_snapshot.json
|
|
318
|
+
│ ├── d2_detections/ # Contract D2: detections.parquet
|
|
319
|
+
│ └── synthetic/ # Synthetic ground truth fixtures
|
|
320
|
+
├── irn/ # Core Engine Python Package
|
|
321
|
+
│ ├── cli.py # Typer CLI application entry point
|
|
322
|
+
│ ├── common/ # Shared coordinate transformations, I/O, logging
|
|
323
|
+
│ │ ├── crs.py # Vectorized WGS84 <-> UTM projections
|
|
324
|
+
│ │ ├── io.py # Atomic file writing & SHA-256 hashing
|
|
325
|
+
│ │ └── logger.py # Structured logging with reason codes
|
|
326
|
+
│ ├── m1_fetcher/ # Module 1: OpenStreetMap Ingestion (Yashika)
|
|
327
|
+
│ │ ├── cleaner.py # Tag normalization & graph topology cleaning
|
|
328
|
+
│ │ └── osm_fetcher.py # OSMnx network download with backoff & caching
|
|
329
|
+
│ ├── m2_cv_interface/ # Module 2: Computer Vision Interface (Vipul)
|
|
330
|
+
│ │ ├── detector.py # YOLOv8 inference & mock generator
|
|
331
|
+
│ │ ├── idd_adapter.py # IDD Multimodal dataset loader
|
|
332
|
+
│ │ └── schema.py # Pydantic schema & PyArrow Parquet writer
|
|
333
|
+
│ ├── m3_fusion/ # Module 3: Geospatial Data Fusion (Yash)
|
|
334
|
+
│ └── m4_compiler/ # Module 4: Simulation Compiler (Vivek)
|
|
335
|
+
├── tests/ # Automated Test Suite (QA Agent)
|
|
336
|
+
│ ├── fixtures/
|
|
337
|
+
│ │ └── synthetic_world.py # Ground-truth mathematical test corridor
|
|
338
|
+
│ └── test_m1_m2_core.py # Core CRS, cleaner, schema, and synthetic tests
|
|
339
|
+
├── AGENTS.md # Multi-Agent Operational Framework & Guardrails
|
|
340
|
+
├── PLAN.md # Master Phased Engineering Plan
|
|
341
|
+
├── pyproject.toml # Package configuration & dependencies
|
|
342
|
+
└── README.md # Project documentation & setup instructions
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## 9. Engineering Constraints & Rules
|
|
348
|
+
|
|
349
|
+
1. **Rule G-1 (Coordinate Systems):** Stored geometries are always WGS84 (`EPSG:4326`). All distance, ray-casting, and metric computations use the local UTM projection calculated from the area centroid.
|
|
350
|
+
2. **Rule G-2 (Traffic Convention):** Strict Left-Hand Traffic (LHT). OpenDRIVE roads declare `rule="LHT"` and SUMO `netconvert` runs with `--lefthand=true`.
|
|
351
|
+
3. **Rule G-3 (Vectorization):** Hot paths use `numpy`, `scipy`, `shapely 2.0`, and `pyarrow`. No Python `for` loops over large detection batches.
|
|
352
|
+
4. **Rule G-4 (File Decoupling):** Modules do not call each other's internal functions across module boundaries. Communication occurs strictly via Data Contracts (D1, D2, D3, D4).
|
|
353
|
+
5. **Rule G-6 (SUMO Construction):** SUMO internal edges are never written by hand. Plain-XML files (`.nod.xml`, `.edg.xml`, `.con.xml`) are compiled via `netconvert`.
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## 10. Contributors & Major Project Team
|
|
358
|
+
|
|
359
|
+
**Department of Computer Science & Engineering**
|
|
360
|
+
**Shri Vaishnav Institute of Information Technology (SVIIT), Indore**
|
|
361
|
+
*B.Tech CSE Major Project (2026–27)*
|
|
362
|
+
|
|
363
|
+
- **Yash Pouranik** — *Team Lead & Algorithmic Owner (Module 3: Geospatial Fusion)*
|
|
364
|
+
- **Yashika Goswami** — *Geospatial Data Engineer (Module 1: Map Fetcher)*
|
|
365
|
+
- **Vipul Yadav** — *Computer Vision Engineer (Module 2: CV Layer)*
|
|
366
|
+
- **Vivek Tekwani** — *Simulation & Standards Engineer (Module 4: Simulation Compiler)*
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
## 11. License & Acknowledgements
|
|
371
|
+
|
|
372
|
+
- **License:** MIT License. See [LICENSE](LICENSE) for details.
|
|
373
|
+
- **Data Attribution:**
|
|
374
|
+
- Road network geometries © [OpenStreetMap contributors](https://www.openstreetmap.org/copyright) (ODbL).
|
|
375
|
+
- Indian Driving Dataset courtesy of [IIIT-Hyderabad CVIT / IDD Multimodal](https://idd.insaan.iiit.ac.in/).
|