Repository navigation
Expand file tree
/
Copy pathbuild_proposal.py
More file actions
238 lines (220 loc) · 12.7 KB
/
Copy pathbuild_proposal.py
File metadata and controls
238 lines (220 loc) · 12.7 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
"""Build the Mini FSD proposal PDF (one-page proposal + weekly plan).
Usage: python build_proposal.py OUTPUT.pdf
"""
import sys
from reportlab.lib.pagesizes import letter
from reportlab.lib.units import inch
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib import colors
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, PageBreak,
Table, TableStyle, ListFlowable, ListItem)
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfbase.pdfmetrics import registerFontFamily
FONT_DIR = "/System/Library/Fonts/Supplemental/"
pdfmetrics.registerFont(TTFont("Arial", FONT_DIR + "Arial.ttf"))
pdfmetrics.registerFont(TTFont("Arial-Bold", FONT_DIR + "Arial Bold.ttf"))
pdfmetrics.registerFont(TTFont("Arial-Italic", FONT_DIR + "Arial Italic.ttf"))
registerFontFamily("Arial", normal="Arial", bold="Arial-Bold", italic="Arial-Italic",
boldItalic="Arial-Bold")
SIZE = float(sys.argv[2]) if len(sys.argv) > 2 else 10.5
LEAD = SIZE * 1.15 # Google Docs default line spacing
body = ParagraphStyle("body", fontName="Arial", fontSize=SIZE, leading=LEAD, spaceAfter=2)
item = ParagraphStyle("item", parent=body, spaceAfter=0.5)
title = ParagraphStyle("title", fontName="Arial-Bold", fontSize=15, leading=18, spaceAfter=1)
sub = ParagraphStyle("sub", fontName="Arial", fontSize=SIZE, leading=LEAD, spaceAfter=5,
textColor=colors.HexColor("#444444"))
h = ParagraphStyle("h", fontName="Arial-Bold", fontSize=SIZE + 1, leading=(SIZE + 1) * 1.15,
spaceBefore=4, spaceAfter=1.5)
cell = ParagraphStyle("cell", fontName="Arial", fontSize=9.5, leading=9.5 * 1.15, spaceAfter=1.5)
hdr = ParagraphStyle("hdr", parent=cell, fontName="Arial-Bold", textColor=colors.white)
def bullets(items, indent=12):
"""A bulleted list. Each item is a string or (string, [sub-items])."""
flow = []
for it in items:
if isinstance(it, tuple):
text, subs = it
flow.append(ListItem([Paragraph(text, item),
bullets(subs, indent)], leftIndent=indent))
else:
flow.append(ListItem(Paragraph(it, item), leftIndent=indent))
return ListFlowable(flow, bulletType="bullet", start="•", leftIndent=indent,
bulletFontSize=SIZE - 1, bulletOffsetY=0)
story = [
Paragraph("Mini FSD: Camera-Only Self-Driving for an Indoor Robot", title),
Paragraph("Oluwasegun Adewola (individual project) · CS5330 Final Project Proposal · "
"November 10, 2026", sub),
Paragraph("Problem and motivation", h),
Paragraph("Tesla’s Full Self-Driving (FSD) drives a car using only cameras. Mini FSD "
"applies the same idea, at small scale, to a robot driving inside a building, "
"in simulation.", body),
bullets([
"<b>Input:</b> a typed instruction (“go to room XYZ”) and live images from the "
"robot’s front camera.",
"<b>Output:</b> a route, plus steering and speed commands that get the robot there "
"safely. For each image, vision marks safe floor, boxes obstacles, people, doors "
"and signs, and estimates depth.",
"<b>Who and why:</b> delivery, hospital and warehouse robots do this on small "
"onboard computers. At 2 m/s, a model that takes 0.1 s per image leaves the robot "
"driving 20 cm blind. I treat my 8 GB laptop, under strict limits, as the robot’s "
"computer and aim for 20 images per second.",
]),
Paragraph("Data", h),
bullets([
("<b>Simulated images (generated by me, ready Nov 23).</b> A program builds "
"random office floors in the MuJoCo simulator. It knows what is in every pixel, "
"so the labels are exact and free.",
["About 10,000 images (384×288) with random textures, lighting, clutter and "
"camera height. Labels: boxes for obstacle, person, door and room sign (COCO "
"format), floor masks, and depth images.",
"Split 80/10/10 by building, so no test building is seen in training. I also "
"rebuild the 3 floors of Northeastern’s Vancouver campus from its floor plans."]),
("<b>Real photos (taken by me, Nov 17–20).</b> About 120 photos of the Vancouver "
"campus and 40 from 2–3 other buildings, taken with a Pixel 8a at knee and eye "
"height. Labeled with floor masks (SAM 2-assisted), boxes and room numbers.",
["Validation (to choose models): floor 1. Test (reported once): floors 2–3 and "
"other buildings."]),
"<b>NYU Depth V2</b> (<a href=\"https://cs.nyu.edu/~fergus/datasets/nyu_depth_v2.html\" color=\"blue\">cs.nyu.edu/~fergus/datasets/nyu_depth_v2.html</a>): 1,449 real "
"indoor images with measured depth and per-pixel labels, including floor (2.8 GB). "
"I use the official 654-image test split: 100 for validation, 554 for test. "
"Public download; link checked Nov 10.",
]),
Paragraph("Technical approach", h),
bullets([
"<b>System:</b> ROS 2 (the standard robotics software framework) connects the "
"simulator, the vision model, and Nav2 (open-source route planning and steering). "
"Vision output becomes a top-down obstacle map, a small version of Tesla’s "
"bird’s-eye view.",
("<b>Models:</b> I compare current small real-time models instead of guessing, "
"and choose on validation data under the same speed limit (published speeds "
"disagree across hardware).",
["Detection: YOLO26n vs. RF-DETR Nano (both built for real-time; one is a CNN, one a transformer).",
"Floor segmentation: EfficientViT-B0 vs. a frozen DINOv3 backbone with a small "
"head (do large pretrained features transfer to real photos better?).",
"Depth: Depth Anything 3 Small vs. V2 Small (top single-camera depth models) vs. "
"a smaller copy of the better one vs. classical stereo from two cameras "
"(OpenCV SGBM, tested in simulation). The robot uses the winner; the photo "
"demo uses the best single-camera model.",
"Then: separate models vs. one shared network (Tesla’s “HydraNet” idea); "
"the winner is compressed."]),
"<b>Baselines:</b> a classical floor finder with no learning (color region "
"growing plus Canny edges), and the same network trained without random textures "
"and lighting.",
"<b>Extra scope, only if time permits:</b> 3–5 robots sharing the building, with a "
"central manager that assigns trips using linear programming.",
]),
Paragraph("Evaluation and expected outcomes", h),
bullets([
"<b>Metrics:</b> floor IoU; mAP at IoU 0.5 for boxes; depth error (AbsRel, "
"δ<1.25) on NYU; milliseconds per image under three hardware limits (similar "
"to a Jetson Orin NX, an Orin Nano, and a Raspberry Pi 5); in simulation, the "
"share of trips that reach the room, collisions, and trip time.",
"<b>Success:</b> floor IoU ≥ 0.80 on real test photos and above the classical "
"baseline; at least 20 images per second; at least 90% of trips succeed in "
"buildings the robot has never seen.",
"<b>Demo images:</b> ordinary indoor photos (hallways, classrooms, offices, "
"lobbies), robot height to handheld. Output: safe floor, boxes, depth, room "
"numbers. Not handled: outdoors, stairs, very dark images.",
]),
Paragraph("Risks and fallback", h),
bullets([
"<b>Models trained on simulated images may fail on real photos.</b> Fallback: "
"stronger randomization, auto-labels from SAM 2 and Depth Anything on extra real "
"frames, and fine-tuning on 50 floor-1 photos.",
"<b>ROS 2 may be unstable on my Mac.</b> Fallback: Docker, then plain Python with "
"a simple route planner.",
]),
PageBreak(),
Paragraph("Weekly plan", title),
Paragraph("Oluwasegun Adewola (individual project): every task below is mine.", sub),
Spacer(1, 2),
]
rows = [
("Week 8<br/>Nov 3–9",
["Researched how Tesla FSD works: camera-only driving, HydraNet, bird’s-eye view, "
"simulation testing.",
"Presented it in class.",
"Agreed with the professor on a simulation-based project."],
["Tesla FSD class presentation."]),
("Week 9<br/>Nov 10–16<br/><i>Proposal and pitch (Nov 10)</i>",
["Submit the proposal and give the pitch.",
"Install ROS 2 and Nav2 on my Mac (Docker as backup).",
"Build the robot in MuJoCo and one campus floor from its floor plan.",
"Stream the robot’s camera into ROS 2 and drive it with the keyboard."],
["Install instructions file.",
"Screen recording of the robot driving, with its camera view.",
"Short note on which install worked."]),
("Week 10<br/>Nov 17–23",
["Write the random-building generator with label export; render about 10,000 "
"images, plus left/right stereo pairs for a held-out set.",
"Calibrate the phone camera with a printed checkerboard (OpenCV).",
"Take and label about 160 real photos.",
"Write the evaluation script (accuracy and speed) and the classical baseline.",
"Start training both detectors on the Explorer cluster."],
["Dataset with image counts per split.",
"Labeled real photos.",
"Script that prints the baseline’s floor IoU and speed."]),
("Week 11<br/>Nov 24–30<br/><i>Progress update (Nov 24)</i>",
["Give the progress update and revise this plan.",
"Finish the detection, floor and depth comparisons (depth includes stereo vs. "
"single camera); pick winners on validation data.",
"Connect Nav2 so “go to room XYZ” plans and drives full trips.",
"Draft the report’s Data section."],
["Three comparison tables with accuracy-vs-speed plots.",
"Video of a full trip.",
"Data section draft."]),
("Week 12<br/>Dec 1–7",
["Compare separate models with one shared network.",
"Measure the effect of random textures and of adding 50 real photos.",
"Feed the camera’s obstacle map into Nav2.",
"Compress the chosen model to INT8; time it under the three hardware limits.",
"Draft the Methods and Results sections."],
["Two comparison tables.",
"Speed table.",
"Video of the robot avoiding obstacles using only its camera.",
"Methods and Results drafts."]),
("Week 13<br/>Dec 8–14<br/><i>Code and report (Dec 8)</i>",
["Finish and submit the report and code.",
"Write the demo program: folder of photos in, labeled photos out, works offline.",
"Test it on held-out photos and rehearse the Dec 15 demo."],
["Report PDF.",
"GitHub repository.",
"Demo program with sample outputs."]),
]
def cell_bullets(items):
return ListFlowable([ListItem(Paragraph(x, cell), leftIndent=9) for x in items],
bulletType="bullet", start="•", leftIndent=9, bulletFontSize=8)
data = [[Paragraph(x, hdr) for x in ("Week", "Task", "Deliverable")]]
for wk, task, deliv in rows:
data.append([Paragraph(wk, cell), cell_bullets(task), cell_bullets(deliv)])
table = Table(data, colWidths=[1.15 * inch, 3.85 * inch, 2.4 * inch],
repeatRows=1)
table.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), colors.black),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#999999")),
("ROWBACKGROUNDS", (0, 1), (-1, -1), [colors.white, colors.HexColor("#f2f2f2")]),
("TOPPADDING", (0, 0), (-1, -1), 6), ("BOTTOMPADDING", (0, 0), (-1, -1), 6),
("LEFTPADDING", (0, 0), (-1, -1), 6), ("RIGHTPADDING", (0, 0), (-1, -1), 6),
]))
story.append(table)
story += [
Spacer(1, 10),
Paragraph("Scope and what I cut if I fall behind", h),
Paragraph("This is sized for one person at about 2.5 mini-projects. The core is the "
"simulator, the generated and real datasets, the model comparisons, and "
"camera-based driving to a room. If I fall behind, I cut in this order:", body),
bullets([
"the 3–5 robot fleet (already marked as extra scope);",
"the INT8 compression and the three hardware limits (I keep one speed measurement "
"on the laptop);",
"the third depth candidate (the smaller copied model), keeping two models in "
"every comparison;",
"the shared-network experiment, using the best separate models instead.",
]),
]
doc = SimpleDocTemplate(sys.argv[1], pagesize=letter, leftMargin=0.7 * inch,
rightMargin=0.7 * inch, topMargin=0.5 * inch,
bottomMargin=0.5 * inch, title="Mini FSD: Final Project Proposal",
author="Oluwasegun Adewola")
doc.build(story)