-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_pptx.py
More file actions
103 lines (90 loc) · 4.16 KB
/
Copy pathgenerate_pptx.py
File metadata and controls
103 lines (90 loc) · 4.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.enum.text import PP_ALIGN
def add_title_slide(prs, title, subtitle):
slide_layout = prs.slide_layouts[0]
slide = prs.slides.add_slide(slide_layout)
title_shape = slide.shapes.title
subtitle_shape = slide.placeholders[1]
title_shape.text = title
subtitle_shape.text = subtitle
def add_bullet_slide(prs, title, bullet_points):
slide_layout = prs.slide_layouts[1]
slide = prs.slides.add_slide(slide_layout)
title_shape = slide.shapes.title
body_shape = slide.placeholders[1]
title_shape.text = title
tf = body_shape.text_frame
for i, point in enumerate(bullet_points):
if i == 0:
p = tf.paragraphs[0]
p.text = point
else:
p = tf.add_paragraph()
p.text = point
p.font.size = Pt(20)
prs = Presentation()
# Slide 1: Title
add_title_slide(
prs,
"Real-Time AI Delivery Tracking System",
"End-to-end, high-throughput spatial event processing architecture"
)
# Slide 2: Executive Summary
add_bullet_slide(
prs,
"Executive Summary",
[
"End-to-end, high-throughput, real-time spatial event processing architecture.",
"Mimics the backend telemetry systems of modern gig-economy delivery platforms (UberEats, Zomato, Swiggy).",
"Offloads complex geospatial calculations and ML inference from traditional REST APIs to a streaming layer (Apache Kafka + PySpark).",
"Achieves sub-second latency for live tracking, routing ETA predictions, and fraud detection."
]
)
# Slide 3: Architecture & Technologies
add_bullet_slide(
prs,
"Architecture & Technologies",
[
"Ingestion (Apache Kafka KRaft mode): Brokers high-throughput GPS location pings asynchronously.",
"Processing Engine (PySpark Structured Streaming): Stateful sliding windows (10-second intervals), real-time ML inferences, and spatial calculations.",
"Backend / Router (Node.js/Express): Kafka Consumer to parse enriched payloads and broadcast updates via WebSockets (Socket.io).",
"Frontend (Leaflet.js & HTML5): Listens to WebSocket events for sub-second map updates and heatmaps."
]
)
# Slide 4: Key Technical Implementations
add_bullet_slide(
prs,
"Key Technical Implementations",
[
"Scalable Event Streaming: Python-based producers push GPS coordinates to Kafka topics.",
"Serverless Spatial Indexing: Uber H3 Indexing maps coordinates to hexagonal spatial bins inside the data stream, generating clustered density heatmaps.",
"Dynamic Geofencing: Spatial UDF checks detect when riders fall within bounded polygons and routes them to a priority alerts topic.",
"Internet Access Tunneling: Integrates NGrok tunneling and Vercel static hosting to ingest real-world GPS streams."
]
)
# Slide 5: Machine Learning on the Edge
add_bullet_slide(
prs,
"Machine Learning on the Edge",
[
"Pre-trained Scikit-Learn models are embedded directly into PySpark User-Defined Functions (UDFs).",
"AI ETA Prediction (Random Forest Regressor): Predicts spatial time-to-completion based on traffic and time-of-day features.",
"Ghost Rider / Fraud Detection (Isolation Forest): Unsupervised anomaly detection model that isolates spoofed GPS coordinates or unrealistic speeds.",
"Impact: Flags anomalies instantly, triggering automated visual alerts directly on the frontend."
]
)
# Slide 6: Performance Metrics & Benchmarking
add_bullet_slide(
prs,
"Performance Metrics & Benchmarking",
[
"Load Test Parameters: Emitting continuous payloads over a 30-second window.",
"10 Concurrent Riders: Processed 300 events (~9.94 msgs/sec).",
"1,000 Concurrent Riders: Processed 27,000 events (~883.68 msgs/sec).",
"10,000 Concurrent Riders: Processed 120,000 events (~3,846.16 msgs/sec).",
"Result: The architecture scaled linearly, demonstrating no bottlenecks at nearly 4,000 GPS messages per second."
]
)
prs.save('Delivery_Tracking_Presentation.pptx')
print("Presentation generated successfully: Delivery_Tracking_Presentation.pptx")