<?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 Robert Reed on Medium]]></title>
        <description><![CDATA[Stories by Robert Reed on Medium]]></description>
        <link>https://medium.com/@robert-mc-reed?source=rss-d098e9d41573------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*g8wmEFMFfyHslL_lG07vhA.jpeg</url>
            <title>Stories by Robert Reed on Medium</title>
            <link>https://medium.com/@robert-mc-reed?source=rss-d098e9d41573------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 06:03:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@robert-mc-reed/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[Scraping for Good: Writing a Proactive COVID-19 Emailer]]></title>
            <link>https://medium.com/swlh/scraping-for-good-writing-a-proactive-covid-19-emailer-f7aa1eb80896?source=rss-d098e9d41573------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7aa1eb80896</guid>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[scraping]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[email]]></category>
            <dc:creator><![CDATA[Robert Reed]]></dc:creator>
            <pubDate>Wed, 28 Oct 2020 23:00:42 GMT</pubDate>
            <atom:updated>2020-10-29T08:32:43.213Z</atom:updated>
            <content:encoded><![CDATA[<h4>Avoid the fear and frustration of obsessively checking for COVID-19 test results. Let a computer obsessively check for you!</h4><figure><img alt="A woman wearing a mask typing on a laptop in the dark" src="https://cdn-images-1.medium.com/max/1024/0*fOqwkmN1BxqOZPVE" /><figcaption>Photo by <a href="https://unsplash.com/@enginakyurt?utm_source=medium&amp;utm_medium=referral">engin akyurt</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This past week I felt a bit unwell. It didn’t seem serious, but I had low energy and felt <em>off</em>. Was I having trouble breathing? Maybe I was, maybe I wasn’t, and maybe (probably) it was all in my head. It seems these days I’ll wake up in the middle of the night, convinced I have COVID-19, only to rise the following morning feeling fine. I’ve never been concerned enough to actually get a test. After all, I practice social distancing, always wear a mask in public, avoid indoor spaces (if at all possible), and wash my hands religiously. However, I’ve had numerous visits to hospitals and other medical facilities as of late in order to help my family, so the possibility of exposure exists.</p><figure><img alt="Symptoms of COVID-19" src="https://cdn-images-1.medium.com/max/1024/1*HMUsREWwoiMgjwxTiDk-bQ.jpeg" /><figcaption><a href="https://news.sanfordhealth.org/wp-content/uploads/2020/04/019037-00504-FACEBOOK-COVID-19-SHN-Symptoms-UPDATED-VERSION-1080x1080-1.jpg">https://news.sanfordhealth.org/wp-content/uploads/2020/04/019037-00504-FACEBOOK-COVID-19-SHN-Symptoms-UPDATED-VERSION-1080x1080-1.jpg</a></figcaption></figure><p>If you look at the list of symptoms that could indicate you have COVID-19, you start to feel a bit helpless. Sore throat, muscle pain, fatigue — these symptoms could easily be explained by countless reasons other than COVID-19. However, <a href="https://www.cnn.com/2020/10/08/health/covid-19-symptoms-mild-moderate-severe-wellness/index.html">there are stories</a> of people who have been diagnosed with COVID-19, but only show very moderate symptoms — if any. I’m <a href="https://www.youtube.com/watch?v=lg0CFUiYkaM">not a doctor</a> and I’m not an expert in self diagnosis, and we’re dealing with a pandemic, so I felt it was my responsibility to self-isolate and get tested.</p><h3><strong>The Test</strong></h3><p>Thankfully I live in Seattle, where drive-up testing sites are easily accessible. If you live in the Seattle area and need to get free testing, you can do so here:</p><p><a href="https://www.seattle.gov/mayor/covid-19/covid-19-testing"><strong>https://www.seattle.gov/mayor/covid-19/covid-19-testing</strong></a></p><p>Signup was a breeze, and I was able to schedule an appointment for the following day. Scheduling is made even simpler, thanks to the <a href="https://www.solvhealth.com/">Solv app</a>. With my appointment scheduled, I arrived 25 minutes early at the provided location, which is fortunate since there was a zoo of cars waiting in line.</p><figure><img alt="A picture of cars waiting in long COVID lines" src="https://cdn-images-1.medium.com/max/1024/1*Hq4c-j5W-WQpgVrPayRNLA.png" /><figcaption>Please ignore my dirty windows</figcaption></figure><p>The test itself wasn’t so bad. It felt like someone stuck an uncooked spaghetti noodle up my nose and through to the back of my throat…and rotated it around for 10 seconds…and then repeated it in the other nostril. Fortunately I didn’t get the brain tickling sensation that others have described. And that was it. They handed me my paperwork containing a retrieval code, and I was off. All said and done the process took around 30 minutes. I was suitably impressed.</p><h3>Now What?</h3><p>And now I’m meant to go home and wait, trying not to think about what could be. The problem is, they only contact you if your test results are positive. If your results are negative, it’s up to you to check the portal for your results. But you have no idea when the results will be ready. It could be hours, or it could be days. They told me to expect my results within 2–3 days, but there have been reports of people receiving their results within 24 hours. So I guess I’m meant to check obsessively until my results are in? Neurotically refreshing the page in the hope that something will show up? I decided I had enough on my plate, and I would defer the neurotic checking to my computer.</p><p>That leads us to the build.</p><h3>The Build</h3><p>My computer is dumb. It doesn’t know how to do things without instructions. In order to help it out, I wrote a simple service to query the test results on my behalf, and to send me notifications upon any changes. In order to automate this process, I needed to understand how it worked. My first step was to query my results manually, and inspect what was happening behind the scenes.</p><p>To do this, I navigated to the URL provided on my paperwork, <a href="https://securelink.labmed.uw.edu/">https://securelink.labmed.uw.edu</a>, and filled in my information. Before submitting my request, I opened Chrome’s Network tab to inspect the submission. Submit.</p><figure><img alt="Image of Chrome Dev Tools Network panel showing useful debugging information" src="https://cdn-images-1.medium.com/max/974/1*_P-4wW7ayPPBj0_foX3JRQ.png" /><figcaption>Dark Mode for life</figcaption></figure><p>Bingo. This tells me everything I need to know. Specifically, I need to make a POST request to <a href="https://securelink.labmed.uw.edu/result">https://securelink.labmed.uw.edu/result</a> with a content-type header of <em>application/x-www-form-urlencoded</em> and form fields <strong>barcode</strong> and <strong>dob</strong>. Interestingly, it’s also redirecting my browser in its response. More on that later.</p><h3><strong>Building the Request</strong></h3><p>There are a plethora of ways I could have written this script, but I chose to build my service using <a href="https://nodejs.org/en/">NodeJS</a>. Everyone loves to hate on JavaScript, but I love its versatility and forgiving nature. So I initialized a new project and installed <a href="https://www.npmjs.com/package/node-fetch">node-fetch</a>. My first step was to mimic the request:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fa660ddb90213dec855dca10e17a9393/href">https://medium.com/media/fa660ddb90213dec855dca10e17a9393/href</a></iframe><p>By calling the text() method on the response object, I’m able to retrieve the actual HTML that is returned from the request. This resulted in a page with more detailed information than I was seeing in the browser. Remember the redirect from earlier? The response was redirecting my browser to a simpler page that merely informed me that my results were pending. However, the actual web request was returning valuable information that my script could use.</p><h3><strong>Parsing the HTML</strong></h3><p>The next step was to parse the html response. In order to help with this, I turned to <a href="https://www.npmjs.com/package/cheerio">cheerio</a>. By passing the raw HTML into cheerio, you can traverse the DOM, extracting bits of information as you see fit. In order to get a better idea of what I was working with, I previewed the HTML in the browser. I could see that it was returning a table that contained some relevant fields. Namely: “Your Result”, “Date resulted”, “Specimen type”, and “Method information”.</p><p>In order to retrieve this information using cheerio you need to provide DOM selectors, similar to how you would use jQuery. Inspecting the HTML manually, it looked like I could grab a reference to all of the rows in the table using the selector “#result-card &gt; div &gt; table &gt; tbody &gt; tr”.</p><p>Now for the semi-messy part. Each row consists of two data cells &lt;td&gt;. I began by iterating over the rows that cheerio found. For each row, I used the index to determine if it was a row I was interested in. If it was, I iterated over each data cell (who’s counting the nested loops?), capturing the text inside.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/30abb7e57716cf367cc32ce3f73f14f6/href">https://medium.com/media/30abb7e57716cf367cc32ce3f73f14f6/href</a></iframe><h3><strong>Getting the Text</strong></h3><p>Unfortunately, not all data cells are created equally. Some had plain text, some were empty except for weird blank spaces, some were composed of &lt;p&gt; tags, and others contained &lt;span&gt; tags. Hence the aptly-named yet as of now undefined function, getText. At the time I was writing this script, my results were not yet available. After all, what would be the point if they were? As such, I had no idea what to expect in terms of the markup returned inside those data cells, other than it could be potentially messy. So, I aimed to write a function robust enough to handle any of the situations I imagined I might encounter. Granted, there is likely a utility built into cheerio that serves this purpose, but I wasn’t able to quickly sort that out, so this seemed like a reasonable path forward.</p><p>As a result of that effort, I ended up writing a recursive function to process the cells. My assumption was that I would encounter two types of nodes. Either it would be a <em>text</em> node, and labeled by cheerio as such, or it would be a <em>tag</em> node with <em>children</em>. My function works as follows. If the node passed to it is in fact a <em>text</em> node, it strips out any extra blank space and returns the text. If, however, it is a <em>tag</em> and has a <em>children</em> attribute, then I iterate over the <em>children</em> (is that the third nested loop?), recursively calling the function (where does that put the loop count?) and appending the results to an accumulation string. Once all <em>children</em> are iterated, the accumulation string is then returned. Rather than spending the time to truly understand the dataset I was working with, I decided to build myself an escape hatch. If the node in question was neither a <em>text </em>node nor a <em>tag</em> with <em>children</em>, the function simply returns an empty string.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eac1344e342c41856323af88d90666e7/href">https://medium.com/media/eac1344e342c41856323af88d90666e7/href</a></iframe><p>And with that it was time to test.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/998ef1478bf0daafd5cfa198cd23e33c/href">https://medium.com/media/998ef1478bf0daafd5cfa198cd23e33c/href</a></iframe><h3><strong>Comparing Results</strong></h3><p>Ok, making progress! Now for a mechanism to compare results. Since I’m only interested in identifying differences and getting results, the simplest solution was to serialize the array returned from the HTML processing and compare it to the last stored value. This requires that I have a previous result to compare to, so I wrote a simple storage solution that allowed me to load stored results, save updated results, and retrieve the last results.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9b765428a6ca4dbc0a22f42a7a8d1e2f/href">https://medium.com/media/9b765428a6ca4dbc0a22f42a7a8d1e2f/href</a></iframe><h3><strong>Sending Alerts</strong></h3><p>The final piece of the puzzle is the alert mechanism. This has all been well and good, and a nice distraction from waiting for the test results, but there’s not much point to this script unless it proactively tells me when my results are in. So, in order to accomplish this I decided I would send myself an email any time the results change. In such, I utilized the <a href="https://nodemailer.com/about/">Nodemailer</a> package with an <a href="https://www.npmjs.com/package/nodemailer-smtp-transport">SMTP transport</a>, which simplifies the process of sending an email via node.</p><p>However, before setting this up I needed a dummy email account. The easiest way I found to set up Nodemailer was to use a Gmail account that has <a href="https://support.google.com/accounts/answer/6010255?hl=en">insecure apps enabled</a>. Sound a little sketchy? Hence the dummy account.</p><p>With the gmail account ready to go, it’s a matter of providing a few key pieces of information. You know, like what you would need to send a normal email.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3b6d7c58f57c1a07bc23ecf586e3702a/href">https://medium.com/media/3b6d7c58f57c1a07bc23ecf586e3702a/href</a></iframe><h3><strong>Putting it all Together</strong></h3><p>With the alert system ready to go, it was time to wire everything together. The different parts flow as laid out in this article. First fetch the results, then parse the response HTML, then compare to the previous results. If the results are different, send an email alert and update the latest results. All together, that looks like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1dd45c297674e8204eca0686e32c24f5/href">https://medium.com/media/1dd45c297674e8204eca0686e32c24f5/href</a></iframe><p>The last piece is to loop this processing code on some sort of interval. I chose to fetch my results once per hour. Sure, we could check more frequently, but I don’t want to add any strain to the medical facilities servers. I figure once per hour is less than I would check if I were to check manually, so I see this as a fair compromise. Granted, this should probably have been set to run as a <a href="https://ostechnix.com/a-beginners-guide-to-cron-jobs/">cron job</a>, but to keep things simple I wrote a loop function that recursively calls itself every hour.</p><p>And that’s it!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/55b178bbf67e1babb8c933c31cdce2ff/href">https://medium.com/media/55b178bbf67e1babb8c933c31cdce2ff/href</a></iframe><h3><strong>Getting Results</strong></h3><p>Two hours after finishing the script, I received my first email informing me of an update.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d42daef379317dd2ba95d94647bc821/href">https://medium.com/media/1d42daef379317dd2ba95d94647bc821/href</a></iframe><p>Success! It’s working! I left the script running overnight on a dedicated machine, and I woke up this morning to yet another email informing me of an update.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d925123ecaa6d20286abd73cbfb34375/href">https://medium.com/media/d925123ecaa6d20286abd73cbfb34375/href</a></iframe><p>17 hours and 46 minutes after sticking a noodle up my nose, my test results came back negative, and I’m sure you know how thankful I am. This project was a fun distraction, and better yet, it actually worked! It was such a relief to not feel the need to obsessively check the portal for updates.</p><p>Feel free to <a href="https://github.com/RobertMcReed/uw-covid-emailer">clone and modify the code</a> to suit your purposes, but please use a reasonable query interval. This script is very dependent on the structure of the UW portal not changing. Considering the lifespan required for my needs, this was a reasonable decision to make. If it doesn’t work for you, play around and get it to work — that’s the fun part!</p><h3><strong>But most importantly, wear a mask and stay safe!</strong></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7aa1eb80896" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/scraping-for-good-writing-a-proactive-covid-19-emailer-f7aa1eb80896">Scraping for Good: Writing a Proactive COVID-19 Emailer</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[D.I.Wyze Person Detection: Part 1]]></title>
            <link>https://medium.com/swlh/wyze-person-detection-part-1-3349e5efdb0?source=rss-d098e9d41573------2</link>
            <guid isPermaLink="false">https://medium.com/p/3349e5efdb0</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[internet-of-things]]></category>
            <category><![CDATA[object-detection]]></category>
            <category><![CDATA[wyze-cam]]></category>
            <category><![CDATA[home-security]]></category>
            <dc:creator><![CDATA[Robert Reed]]></dc:creator>
            <pubDate>Thu, 12 Dec 2019 06:43:15 GMT</pubDate>
            <atom:updated>2019-12-17T06:01:11.199Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Building a smart security system with Python, a Wyze cam, and some ingenuity.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qxH2Zk0K5e3uFozQH9kkkA.png" /><figcaption>Illustration by <a href="https://www.emans.design/">Emans</a></figcaption></figure><h3>Part 1: <em>Taking Control</em></h3><p>Over the past year my home has become increasingly intelligent. Smart bulbs illuminate as I enter rooms and darken as I leave. Door sensors gossip to WiFi outlets so my dogs can see at night. Even my Christmas tree bends to my whims, LEDs dancing in quiet obedience.</p><p>But for all the fun and countless hours spent making my home smarter — resulting in a cumulative savings of tens of seconds, but who wants to get out of bed to turn off the lights? — one connected device I had yet to purchase was a security camera. I simply couldn’t justify spending $200+ on a device I really didn’t need. That would remain the case to this day if not for a fatefully clogged bathtub drain.</p><p>As I wandered the aisles of <a href="https://www.homedepot.com/p/Wyze-1080p-WyzeCam-HD-Wi-Fi-Indoor-Smart-Home-Camera-Night-Vision-2-Way-Mic-Alexa-Ready-Free-14-Day-Cloud-Drive-WYZEC2/308137578">Home Depot</a>, absorbing the expanse of items while looking for a drain snake, I was suddenly presented with an opportunity. Stacked before me in a delicate tower was a collection of smart devices — bulbs, outlets, sensors, and <em>cameras</em> — for ridiculously low prices. While my fiancée patiently browsed holiday decorations, I frantically Googled this new-to-me manufacturer, <a href="https://wyze.com/">Wyze</a>.</p><p>To my delight, the cameras seemed revered, and boasted a suite of intelligent features — 1080p HD video, night vision, motion detection, and even person detection. For $25 I was sold (literally) and shortly thereafter I had the camera set up on my front porch. Within minutes my camera began alerting me to every car driving by, every bug flying past, and every tree blowing gently in the wind.</p><figure><img alt="A low resolution GIF of the view of a street from a porch with a bunch of cars driving past." src="https://cdn-images-1.medium.com/max/1024/1*AQa02X4hLVWQ9pslfz0SZA.gif" /><figcaption>Yes, most of my plants are dead.</figcaption></figure><p>While it was <em>slightly</em> entertaining to see the sheer number and variety of cars that drove down my street, the constant notifications quickly outgrew their novelty. After all, my primary goal with this new camera was to detect package deliveries, not cars. Thankfully, Wyze provides a number of options to limit the onslaught of notifications. You can lower the sensitivity of the motion detector and limit the size of the “Detection Zone”. What’s more, the Wyze Cam even supports <em>on-device</em> person detection, allowing you to filter between people and other types of motion.</p><p>However, a problem arises when motion is detected <em>before</em> a person is in the frame. <a href="https://forums.wyzecam.com/t/time-gaps-between-motion-detection/3506/14">There is a five minute delay between notifications</a>, so it is quite possible to detect motion and miss a person entirely. On top of that, a few days after getting my camera I received an email from Wyze informing me that their partnership with <a href="https://www.xnor.ai/"><em>xnor.ai</em></a> was ending, and that they would be removing person detection from their next firmware update. To their credit, they were extremely apologetic and promised to remedy the situation (from their own wallets if necessary) as quickly as possible.</p><p>Although their apology seemed genuine, I now own multiple cameras that can’t <em>immediately</em> serve their intended purpose. So, what do we do when something off the shelf doesn’t quite suit our needs? Take matters into our own hands and build it ourselves!</p><h4>Enabling RTSP</h4><p>To build our own person detector, we’ll first need access to the video feed. One of the less obvious features of the Wyze Cam is the ability to enable <a href="https://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol"><em>Real Time Streaming Protocol</em></a> (RTSP). Doing so allows you to stream live footage directly to devices on your home network. Turning on RTSP is not as simple as flipping a switch, but Wyze has made the process fairly straightforward. They developed an alternative firmware that allows you to enable RTSP, conveniently exposing new options in the app.</p><p>The process is <a href="https://support.wyzecam.com/hc/en-us/articles/360026245231-Wyze-Cam-RTSP?flash_digest=630b29ed5ddba4551c15029f9d8006765ae1ad0c#">well documented</a>, and the only additional hardware requirement is a microSD card. To prep the card, simply download the RTSP firmware (<a href="https://download.wyzecam.com/firmware/rtsp/demo_V2_RTSP_4.28.4.41.zip">Wyze Cam V2</a>/<a href="https://download.wyzecam.com/firmware/rtsp/demo_Pan_rtsp_4.29.4.41.zip">Wyze Cam Pan</a>), unzip the archive, and save it to the card’s root as “demo.bin”. With the card prepped, insert it into the slot located on the bottom of the camera, hold the setup button while powering on the device, and you should be good to go…</p><p>…or so the documentation would lead you to believe. Unfortunately, that wasn’t my experience. After failing to flash the firmware multiple times, I stumbled onto the <a href="https://forums.wyzecam.com/t/real-time-streaming-protocol-rtsp/6694/984">Wyze blog</a> where folks were murmuring about similar problems. Some alleged that flashing the alternate firmware had been blocked in the latest <em>regular</em> firmware release. This may or may not have been the case (folks have since speculated that it was perhaps an issue with the microSD card and <em>not</em> the firmware), but it inspired me to try downgrading to <a href="https://support.wyzecam.com/hc/en-us/articles/360024852172">a previous firmware</a> (I loaded <a href="https://download.wyzecam.com/firmware/v2/4_9_4_169.bin.zip">V4.9.4.169</a><strong> </strong>without problem), and <em>then</em> flashing the RTSP firmware, which worked on the first try.</p><h4>Accessing the Stream</h4><p>Once the firmware is flashed and the camera reboots, enable RTSP through the app by accessing <strong>Settings &gt; Advanced Settings &gt; RTSP</strong>. After enabling the stream, generate the url to access it. It should be of the following form:</p><pre>rtsp://&lt;camera_name&gt;:&lt;some_uuid&gt;@&lt;some_ip&gt;/live</pre><p>The simplest way to view the stream (IMO) is with <a href="https://www.videolan.org/vlc/">VLC Player</a>. You can do so by going to <strong>File &gt; Open Network…</strong> and pasting the link generated by the Wyze app. You should now be seeing a real-time feed from your camera. You will find that it is a few seconds delayed, but other than that it should work well.</p><p>But our goal is to build a person detector, and to do so we need programmatic access to the stream. In this instance, as in many others, <a href="https://www.python.org/">Python</a> is our friend.</p><h4>Viewing the Stream with Python</h4><p>To access the stream, we will be using <a href="https://opencv.org/">OpenCV</a> and a helper library called <a href="https://pypi.org/project/imutils/">imutils</a>. Although it’s not <em>required</em>, I would recommend you begin by creating a virtual environment (<a href="https://www.google.com/url?q=https://docs.python.org/3/tutorial/venv.html&amp;sa=D&amp;ust=1576123740295000&amp;usg=AFQjCNEeXc7Y1MhkTFjosW-4WZF5NBrWog">whichever</a> <a href="https://docs.python-guide.org/dev/virtualenvs/#virtualenvwrapper">type</a> <a href="https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands">you</a> <a href="https://github.com/pyenv/pyenv-virtualenv">fancy</a>) for the project. With the environment set, install the dependencies:</p><pre>pip install opencv-python imutils</pre><p>With the level of abstraction these two libraries provide, remarkably few lines of code are required to view the stream:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/806ec8ccd75e47870e203c6d8c0e96bb/href">https://medium.com/media/806ec8ccd75e47870e203c6d8c0e96bb/href</a></iframe><figure><img alt="Wyze Cam live stream over RTSP with Python." src="https://cdn-images-1.medium.com/max/960/1*RpaQBWT23DcnHN5M-pU9AA.gif" /><figcaption><em>Low image quality due to poor GIFing</em></figcaption></figure><p>With access to the raw frames in Python, we can now work towards building a person detection system that better suits our needs. In my next post in this series, I’ll show how we can do that <em>and more</em>. Keep an eye out for it later this month!</p><p>By the end of this series, we will have built a robust home security system capable of detecting people, saving videos, sending notifications, and uploading footage to the cloud — all running on a TPU accelerated RaspberryPi 4! Stay tuned!</p><p><em>If you’d like to get a jump-start on implementing the person detection, take a look at this </em><a href="https://www.pyimagesearch.com/2018/05/14/a-gentle-guide-to-deep-learning-object-detection/"><em>excellent blog post</em></a><em> which covers the topic in depth.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3349e5efdb0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/wyze-person-detection-part-1-3349e5efdb0">D.I.Wyze Person Detection: Part 1</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>