damnlinesdamnlines.com
Document // About

Know before you go.

We pay tenants across NYC to install an IP camera outside of their unit to monitor the line. It's not really sustainable, yet.

Technical // Engineering

Three ideas power every estimate on damnlines: a 60-year-old theorem, a service-rate observer, and a real-time people counter.

//00 — Camera Hours
Cameras only stream from 1 hour before a business opens to 1 hour after it closes. Outside of that window, cameras are completely off — no recording, no streaming, no data collection.
status = open_hour - 1h .. close_hour + 1h ? LIVE : OFF
If a location shows "offline," that's why. The camera isn't broken — it's just not operating hours.
//01 — Little's Law
The average number of people in a stable queue equals the rate they arrive multiplied by how long each person waits.
L = λ × W
L = average number of people in the queue
λ (lambda) = arrival rate — people joining per minute
W = average time each person spends waiting
This holds regardless of arrival patterns, service variability, or how the queue is structured. It's a universal law of queuing systems — and the foundation of everything we calculate.
Example: If 2 people join the line per minute and each waits 5 minutes, the line will average 10 people. Double the arrival rate and it jumps to 20.
Queue length by wait time & arrival rate
── λ = 1/min── λ = 2/min── λ = 4/min
//02 — Wait Estimation
To estimate how long you'd wait if you joined the line right now, we rearrange Little's Law:
West = L / μ
West = your estimated wait time
L = people currently in line
μ (mu) = service rate — people leaving the queue per minute
We calculate μ by observing how many people exit the queue over a rolling time window. The more observations we collect, the more accurate the rate becomes.
When there isn't enough historical data to compute a reliable service rate, we fall back to a conservative per-person estimate. It's better to overestimate your wait than to send you somewhere with a false sense of speed.
Example: 12 people in line, service rate of 4/min → estimated wait ≈ 3 minutes. Same 12-person line at 2/min → 6 minutes.
Estimated wait by queue length & service rate
── Slow (2/min)── Moderate (4/min)── Fast (8/min)
//03 — People Counting
Every estimate starts with an accurate count. Here's how we derive it:
1. Detection
Each video frame is analyzed to locate individuals using computer vision. The model outputs a bounding box around every detected person.
2. Tracking
Detections are linked across frames to maintain consistent identities. Person #42 in frame 1 is matched to the same individual in frame 30 — even if they've moved significantly.
3. Zone counting
A queue zone is defined in the camera's field of view. When a tracked person crosses into the zone, the count increments. When they leave, it decrements.
4. Dwell time
We measure how long each person remains inside the zone. This per-person timing feeds directly into service rate and wait time calculations.
current_count = Σ entries − Σ exits
Sample: estimated queue length over a day

Every few seconds the system captures a frame, detects people, updates the count, recalculates the service rate, and pushes a fresh estimate to your screen. The entire pipeline — from camera to prediction — runs continuously throughout operating hours.

//EOF
cowsay "No one likes waiting in a damn line."
________________________________________
< No one likes waiting in a damn line. >
----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
fortune
Time you enjoy wasting is not wasted time.
But time spent in a line you could have skipped? That's just dumb.
About | damnlines