<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohammad Zaid on Medium]]></title>
        <description><![CDATA[Stories by Mohammad Zaid on Medium]]></description>
        <link>https://medium.com/@diaz3z?source=rss-365cbc76d079------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*k-njGZllSQ2zKFfzVyBG5A.jpeg</url>
            <title>Stories by Mohammad Zaid on Medium</title>
            <link>https://medium.com/@diaz3z?source=rss-365cbc76d079------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 10:21:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@diaz3z/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Two Failed Attempts Before I Got Real-Time Person Detection Working on a Raspberry Pi 5]]></title>
            <link>https://diaz3z.medium.com/two-failed-attempts-before-i-got-real-time-person-detection-working-on-a-raspberry-pi-5-5922107bbd36?source=rss-365cbc76d079------2</link>
            <guid isPermaLink="false">https://medium.com/p/5922107bbd36</guid>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[industrial-automation]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Mohammad Zaid]]></dc:creator>
            <pubDate>Mon, 27 Jul 2026 06:54:14 GMT</pubDate>
            <atom:updated>2026-07-27T06:54:14.877Z</atom:updated>
            <content:encoded><![CDATA[<p>I was building a proximity alert system for forklifts — the kind that watches for people walking too close to a moving forklift and fires an alert before something bad happens. On paper, it’s a straightforward person-detection problem. In practice, it became a lesson in how much “run the model faster” actually means “figure out where the real bottleneck is.”</p><p>The hardware was a Raspberry Pi 5. No GPU, no accelerator card, just CPU inference on an edge board that also had to survive a factory floor. And the requirement wasn’t “runs eventually”, it was real-time. If a person steps into the danger zone and the alert fires half a second late, the system isn’t doing its job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0VNHu34xsMdFLe3_Y6fXUQ.png" /></figure><h3>Attempt 1: ONNX, and it just wasn’t fast enough</h3><p>The obvious first move was to export the model to ONNX and run it with ONNX Runtime on the Pi. This is the standard path, it’s the one every tutorial (including one I wrote myself) walks you through. Export, load, run.</p><p>It worked. It just didn’t work <em>fast enough</em>. The inference loop couldn’t keep up with a live camera feed, by the time a detection came back, the forklift had already moved. For a safety system, “eventually correct” is the same as “wrong.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kKnzEQNL_zPXaAOAbW0Pfg.png" /></figure><h3>Attempt 2: Quantization, which sounded like the fix but wasn’t</h3><p>The next instinct was quantization, drop the model from FP32 to INT8, shrink it, speed it up. This is the textbook answer, and it’s the kind of thing that looks great in a blog post because the theory is clean: smaller weights, faster math, done.</p><p>It didn’t move the needle the way I needed. The speed barely changed and I still lost a bit of accuracy for the trouble. That’s the worst version of this trade-off: you’re supposed to give up some precision to buy real speed, and here I’d given up precision and gotten nothing back for it.</p><p>That was the moment the problem stopped being “which format do I export to” and started being “which runtime actually knows how to use this hardware.” Quantization is only a win if the runtime underneath it has kernels that actually exploit INT8 on your chip, otherwise you’re just running a slightly worse model at the same speed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-7SerlFjBsgoQ0ylKjjCgA.png" /></figure><h3>What actually worked: converting to NCNN</h3><p>NCNN is built with ARM CPUs in mind from the ground up, not adapted for them after the fact. Converting the model into NCNN’s format and running inference through it gave me real-time alerts, the detection loop finally kept pace with the camera feed, without giving up meaningful accuracy on the person-detection task.</p><p>The lesson buried in there: ONNX Runtime and NCNN are both “run this model on CPU” tools, but they’re not interchangeable. One is built for broad compatibility. The other is built for exactly this kind of ARM-constrained, no-GPU, has-to-be-real-time deployment. Picking the general-purpose tool first felt reasonable, it’s the default path but the project needed the specialized one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ytP3mv36n34LMIEwer2IdQ.png" /></figure><h3>The part I didn’t expect</h3><p>Switching to NCNN was the moment everything changed, the jump in inference speed alone was enough to turn a laggy system into a real-time one. If you’re chasing a similar issue, trust that instinct to look hard at the model and runtime first.</p><p>What I didn’t fully appreciate going in was that the fix couldn’t stop there. Getting inference fast was necessary but not sufficient, the danger-zone alert only works if the <em>entire</em> loop keeps pace: capturing the frame, resizing it, converting color formats, running inference, then turning the output into an actual decision and firing the alert. Every one of those stages was competing for the same limited CPU on the Pi 5, with no GPU to absorb the slack. I’d mentally filed all of that under “the easy part” while I was focused on the model, it wasn’t, and it still needed attention even after NCNN solved the biggest chunk of the problem.</p><p>The takeaway: NCNN fixed the main bottleneck, but treating the whole pipeline, not just the model, as one time budget is what actually got the system to real-time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F82eEeMfotUTyK5VjFrVow.png" /></figure><h3>What I’d tell someone starting the same project</h3><p>If you’re deploying person or object detection on a Raspberry Pi (or similar CPU-only edge hardware) for something safety-critical:</p><ul><li>Don’t assume ONNX Runtime is fast enough just because it’s the standard export path, test the actual frame rate on your target hardware early, not after the rest of the pipeline is built.</li><li>Quantization isn’t a guaranteed win. It depends heavily on whether the runtime you’re using has good low-precision kernels for your specific chip.</li><li>If you’re on ARM without a GPU, look at inference engines built specifically for that (NCNN, and others like it) before spending time optimizing within a more general-purpose runtime.</li><li>Real-time isn’t just an inference-speed number, check the whole loop, from camera to alert, not just the model’s forward pass.</li></ul><p>The version of this project that shipped isn’t the one I designed on paper. It’s the one that survived two wrong turns first.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5922107bbd36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Camera Calibration? How It Helps in Computer Vision Tasks]]></title>
            <link>https://diaz3z.medium.com/what-is-camera-calibration-how-it-helps-in-computer-vision-tasks-f740306c7246?source=rss-365cbc76d079------2</link>
            <guid isPermaLink="false">https://medium.com/p/f740306c7246</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Mohammad Zaid]]></dc:creator>
            <pubDate>Thu, 30 Apr 2026 04:43:44 GMT</pubDate>
            <atom:updated>2026-04-30T04:43:44.417Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A ground truth guide to how cameras distort reality and why calibration is critical for accurate computer vision systems.</em></p><p>Most people hear “camera calibration” and immediately think math.</p><p>Matrices. Distortion coefficients. Intrinsics. Extrinsics.</p><p>Then they open a tutorial, see a chessboard, and decide to “come back to it later.”</p><p>Later never comes.</p><p>Until the system starts giving answers that look right but are completely wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*auURB-s7ljMrgPN5UPeIGw.png" /></figure><h3><strong>What camera calibration actually is</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0PozaGRKgJtfbol0Ecnneg.png" /></figure><p>Camera calibration is not a fancy optimization problem.</p><p>It’s this:</p><p><strong>Figuring out how your camera distorts reality and correcting for it.</strong></p><p>A camera does not capture the world as it is.</p><p>It:</p><ul><li>Bends straight lines (lens distortion)</li><li>Changes scale based on distance</li><li>Flattens a 3D world into 2D</li></ul><p>Calibration learns these quirks and gives you a way to undo them.</p><p>So instead of working with “what the camera sees,” you work with something closer to <strong>what actually exists</strong>.</p><h3><strong>The two parts nobody remembers (but everyone uses)</strong></h3><p>You don’t need to memorize equations. Just understand the split:</p><p><strong>1. Intrinsics - how the camera sees</strong></p><ul><li>Focal length</li><li>Optical center</li><li>Lens distortion</li></ul><p>This fixes <em>image distortion</em>. Straight lines become straight again.</p><p><strong>2. Extrinsics - where the camera is</strong></p><ul><li>Position</li><li>Orientation</li></ul><p>This connects the image to the real world. For example: knowing your camera is mounted 3m high at a 45° angle lets you map detections directly to floor coordinates.</p><p>If your task involves <em>where</em> something is - not just <em>what</em> it is - extrinsics matter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LHD-KspE0f2sljOSdLAquQ.png" /></figure><h3><strong>Why calibration exists in the first place</strong></h3><p>Because pixels are not real units.</p><p>A box that is 100 pixels wide:</p><ul><li>Might be 5 cm in one part of the image</li><li>Might be 8 cm in another</li></ul><p>Same object. Same camera. Different interpretation.</p><p>Calibration gives meaning to pixels.</p><p>Without it, you’re building systems on top of shifting ground.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AzZelCNYtS042husbPiDlw.png" /></figure><h3><strong>How it actually helps in vision tasks?</strong></h3><p>This is where calibration stops being “theory” and starts saving you from production issues.</p><ol><li><strong>Real-world measurements become possible</strong></li></ol><p>Want to measure:</p><ul><li>Object size</li><li>Distance between items</li><li>Speed on a conveyor</li></ul><p>Without calibration, you’re guessing.</p><p>With calibration, you can map pixels → real-world units.</p><p>That’s the difference between a demo and a usable system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FI_bfzTfBUILvuNRsjjyUQ.png" /></figure><p><strong>2. Perspective stops messing with your model</strong></p><p>Objects:</p><ul><li>Look smaller when far</li><li>Look distorted at angles</li></ul><p>Your model learns this whether you like it or not.</p><p>Calibration corrects lens distortion. Perspective effects (objects appearing smaller with distance) require additional steps like homography or 3D reconstruction but calibration is the foundation that makes those possible.</p><p>Result: more consistent predictions across the frame.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*88zpE4OfKlwJPQTFUcRc-w.png" /></figure><p><strong>3. You reduce “invisible” errors</strong></p><p>The worst failures are not crashes.</p><p>They are:</p><ul><li>Slightly wrong measurements</li><li>Slightly shifted detections</li><li>Slight inconsistencies</li></ul><p>Individually harmless. Collectively disastrous.</p><p>Calibration removes an entire class of these silent errors.</p><h3><strong>When you actually need calibration (and when you don’t)</strong></h3><p>Not every problem needs it. Don’t overengineer.</p><p>You <strong>need calibration</strong> when:</p><ul><li>You measure real-world dimensions</li><li>Distance or speed matters</li><li>You use multiple cameras</li><li>You care about geometry (pose, tracking, 3D)</li></ul><p>You can <strong>skip it (for now)</strong> when:</p><ul><li>Pure classification</li><li>Rough detection tasks</li><li>No real-world measurements involved</li></ul><p>But here’s the catch:</p><p>Most systems don’t stay simple.</p><p>The moment someone asks<br> “Can we measure this?”<br> you’re coming back to calibration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C-2jxRCnViywMrScYTa4MQ.png" /></figure><h3>Why teams keep skipping it</h3><p>Because:</p><ul><li>The model “works” without it</li><li>It’s not visible in early demos</li><li>It feels like setup overhead</li></ul><p>So it gets postponed.</p><p>And later, when things don’t add up, people blame:</p><ul><li>The model</li><li>The data</li><li>The hardware</li></ul><p>Calibration sits there quietly being the actual issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aFOZwkDOCOhk6_phB-joqA.png" /></figure><h3>Final note</h3><p>You can spend weeks improving model performance by a few percent.</p><p>Or you can calibrate your camera and remove entire categories of errors in one go.</p><p>One of these feels like progress.</p><p>The other actually is.</p><blockquote>Pixels are not measurements.</blockquote><blockquote>They are guesses.</blockquote><blockquote>If your system measures anything, calibration is not optional.</blockquote><p><strong>If you’re building real-world vision systems, you might like this:</strong></p><p><a href="https://medium.com/@diaz3z/what-building-computer-vision-solutions-across-industries-taught-me-in-under-a-year-67000328ffb1"><em>What building computer vision solutions across industries taught me in under a yea</em>r</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f740306c7246" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What building computer vision solutions across industries taught me in under a year]]></title>
            <link>https://diaz3z.medium.com/what-building-computer-vision-solutions-across-industries-taught-me-in-under-a-year-67000328ffb1?source=rss-365cbc76d079------2</link>
            <guid isPermaLink="false">https://medium.com/p/67000328ffb1</guid>
            <category><![CDATA[yolo]]></category>
            <category><![CDATA[computer-vision-project]]></category>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[real-world-ai-systems]]></category>
            <category><![CDATA[model-optimization]]></category>
            <dc:creator><![CDATA[Mohammad Zaid]]></dc:creator>
            <pubDate>Thu, 23 Apr 2026 04:08:11 GMT</pubDate>
            <atom:updated>2026-04-23T04:08:11.669Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A ground truth piece on patterns that repeat no matter the domain. Hiring managers eat this up.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8yBPYs5cviSGfVRtuctF4Q.png" /></figure><p>I joined a startup to build computer vision solutions across packaging, bottling, security, and surveillance. Different industries. Different jargon. Same chaos. One year in, the tech stack changed. The customers changed. The cameras changed. The problems did not.</p><p>This is a field report from the trenches. No academic flexing. No demo day gloss. Just what actually repeats when you ship vision systems into the real world.</p><p><strong><em>Every problem claims to be unique. None of them are.</em></strong></p><p>Every customer starts with a slide that says their setup is special. Custom lighting. Custom materials. Custom edge cases. By week three you realize it maps cleanly to one of three buckets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g2BdInKyPqWPeuvPKtVSjg.png" /></figure><blockquote><strong>1. Detect something that should not be there</strong></blockquote><blockquote><strong>2. Verify something that should be there</strong></blockquote><blockquote><strong>3. Measure whether something crossed a tolerance line</strong></blockquote><p>Packaging defects. Missing caps. Intrusion detection. Line crossing. Same playbook. Different nouns. The faster you collapse the problem into one of these shapes, the faster you stop overengineering.</p><p><strong>Data beats models. Every single time.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oiYvmhgvM78KleZWjgFgYg.png" /></figure><p>Nobody wants to hear this in a pitch meeting, but the model is rarely the bottleneck. Data quality, labeling discipline, and camera placement decide the outcome before training even starts.</p><p>A mediocre architecture with clean data ships. A state of the art model with noisy labels dies quietly in staging. If you want leverage, spend time on annotation rules, edge case definitions, and feedback loops from production. That is where accuracy actually moves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bHpogANs7YAMWenrL62Yhw.png" /></figure><p><strong>Lighting is the real product manager</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VjO7-K_srILC8mTBbGPM1w.png" /></figure><p>In packaging and bottling, lighting decides your fate. In surveillance, shadows do. In security, night mode ruins your metrics.</p><p>You can fight physics with clever augmentations, or you can move a light six inches and save three months of tuning. The best engineers learn when to close the laptop and adjust the environment.</p><p>This is not giving up. This is winning.</p><p><strong>Edge cases are not rare. They are the business.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PNH0i5JRbiQkxDhKb6vJLg.png" /></figure><p>Every customer says edge cases are five percent. They are lying. The moment you deploy, that five percent becomes the only thing anyone talks about.</p><blockquote><strong>1. Crushed bottles</strong></blockquote><blockquote><strong>2. Reflections on plastic wrap</strong></blockquote><blockquote><strong>3. Rain on lenses</strong></blockquote><blockquote><strong>4. People wearing things the dataset never imagined</strong></blockquote><p>Production vision systems live and die by how fast you surface, label, and patch these cases. If your pipeline cannot absorb them quickly, accuracy will decay while everyone argues about blame.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3GRFrnMQXy1mHszT5uo_Cg.png" /></figure><p><strong>The real skill is saying no</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qjyzu2uRjHpfFp_CkWGIbQ.png" /></figure><p>The fastest way to kill a vision system is to say yes to every feature request.</p><blockquote><strong>Can it detect this too</strong></blockquote><blockquote><strong>Can it work from this angle</strong></blockquote><blockquote><strong>Can it run on this older camera</strong></blockquote><blockquote><strong>Can we lower latency without changing hardware</strong></blockquote><p>Strong systems come from clear boundaries. Clear boundaries come from engineers who can translate technical limits into business language without sounding defensive.</p><p>This skill compounds faster than any framework knowledge.</p><p><strong>Metrics lie unless you babysit them</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m39UYxbD1omV_t5QF92HTw.png" /></figure><blockquote>Offline accuracy looks great. Production tells a different story.</blockquote><p>Distribution shifts. Camera drift. Operator behavior. Silent failures. If you do not actively monitor false positives and false negatives by scenario, your dashboard will smile while customers churn.</p><p>Good engineers build evaluation hooks into production from day one. Not later. Not next sprint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kbG8E8H3N0rmmUtkdnulXg.png" /></figure><p><strong>Domain knowledge matters less than pattern recognition</strong></p><p>I walked into industries I knew nothing about. Within weeks, I was productive.</p><p><strong>Why ?</strong></p><blockquote>1. Because the patterns repeat.</blockquote><blockquote>2. Bad data pipelines</blockquote><blockquote>3. Unclear success criteria</blockquote><blockquote>4. Hardware constraints ignored until deployment</blockquote><blockquote>5. Last minute changes blamed on the model</blockquote><p>If you can recognize these early, domain ramp up becomes a solvable problem instead of a blocker.</p><p><strong>Shipping beats perfection. Every quarter.</strong></p><p>The systems that survived were not the cleanest or the cleverest. They were the ones that shipped, learned, and iterated under real constraints.</p><p>Customers forgive early flaws. They do not forgive silence or slow response.</p><p>Momentum wins.</p><p><strong>Final takeaway for anyone building vision systems</strong></p><p>Computer vision in production is not a research problem. It is a systems problem with political, physical, and human constraints.</p><p>If you can balance models, data, hardware, and expectations while moving fast, you will win in any vertical. If you cannot, no architecture will save you.</p><p>Hiring managers like to ask about domain experience. The real signal is whether you have shipped vision systems that survived contact with reality.</p><h4>Everything else is noise.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8URnc2thKFYwXNawxIAaKA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67000328ffb1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>