Click here to Skip to main content
15,867,488 members
Articles / Artificial Intelligence

How to Setup Blue Iris and CodeProject.AI Server on Windows Using a Wyze Cam

Rate me:
Please Sign up or sign in to vote.
5.00/5 (5 votes)
28 Oct 2022CPOL18 min read 44.1K   3   10
In this article, I walk you through setting up CodeProject.AI Server and Blue Iris using a Wyze Cam v3.
In this article, you will learn how to install CodeProject.AI Server, install and set up Blue Iris, set up a Wyze cam, and use all that to detect an object, step by step.

Image 1

I was interested in playing around with artificial intelligence (AI) and I decided to start small with  object detection. So I bought a Wyze cam and downloaded Blue Iris and CodeProject.AI Server. I managed to set them up with a little help from my friends, but saw a lot of people in various forums asking for all kinds of help with multiple parts of this process. In this article, I walk you through installing CodeProject.AI Server, installing and setting up Blue Iris, setting up a Wyze cam, and using all that to detect an object, step by step.

Things You Will Need

I thought all I needed was a Wyze cam, but that was not the case. Some of these items you might have lying around your home anyway, but I didn't. Here's a full list of what you'll need:

  • A Wyze Cam - I went with a Wyze Cam v3 and I got mine off Amazon for $34 USD
  • A microSD storage card - You might have a camera that has one of these, but I didn't. I got mine off of Amazon for $9 USD.
  • A microSD Card Reader - Most microSD cards come with an adapter, but you will also need a microSD card reader because you need to write to it. Got mine off Amazon for $8 USD.

Installing CodeProject.AI Server

The first step is to install CodeProject.AI Server. I'm installing version 1.6.7.0, so you may experience some differences if you're using a different version.

Image 2

Go to codeproject.com, then from the homepage, click the Download link on the CodeProject.AI hero banner, which goes to the latest version download page.

Image 3

The page automatically downloads a zip file. I have WinZip (because I hate myself), but you can use PeaZip or whichever compression software you want. From Winzip, double-click CodeProject.AI.Server-1.6.7.0.exe and begin the install process.

Image 4

Make sure you check the, "I agree to the license terms and conditions" box, then hit Install.

Image 5

A CodeProject.AI Server Setup window pops up, and this runs for a couple of minutes. CodeProject.AI Server is meant to be an out-of-the-box solution so it installs all the Python libraries and detection modules that you need. This is pretty helpful. It's hard to know which Python libraries you need and time-consuming to search around for training models. Heck, the other day I tried installing Python to run a pip command, and I couldn't get it running. That's an article for another day.

Image 6

A lot of Python scripts show up as CodeProject.AI Server installs. Don't worry about these. Though, I've installed CodeProject.AI Server several times now, and one time I clicked inside one of these scripts while it was installing, hit Enter, and the progress bar froze. Out of superstition, I'm going to say, don't touch these boxes, just let them install.

Image 7

The setup window displays its progress with a green loading bar. Then, when it's all done, an Installation Successfully Completed window pops up. Hit Close.

Image 8

That's it! CodeProject.AI Server is installed.

Installing Blue Iris

Now we need some video webcam software. CodeProject.AI Server is built into Blue Iris, so head to blueirissoftware.com.

This software requires a license if you're using it for more than 15 days. For now, I'm using the trial version. The current version as of writing this article is version 5, so I'm installing that. If you are using a different version, your experience may differ.

Image 9

Navigate to the download tab and click on Download V5, which downloads blueiris.exe. From here, double-click blueiris.exe to start the installation process, which launches the setup wizard.

Image 10

Click the box to accept the terms of the license agreement, then hit Next.

You can install Blue Iris on whatever drive you want. Then hit Next, then Install.

Image 11

Once Blue Iris finishes installing, you have the option to launch it and the readme file. I just want to launch Blue Iris, so I uncheck the readme box and hit Finish.

Image 12

This activation window indicates how many days are left for the free trial. Mine says 8 because I installed it seven days go. I'll purchase a license later. Probably, the Lite Version which costs $34.95 USD and supports one camera.

For now, hit Demo to launch Blue Iris.

Image 13

Because CodeProject.AI Server is integrated into Blue Iris, if you don't have CodeProject.AI Server installed, you'll see a prompt that asks if you want to install CodeProject.AI Server for AI Alert confirmation. If you click Yes, it will take you to the latest downloads page for CodeProject.AI Server. We already downloaded and installed CodeProject.AI Server so we won't see this dialog.

Image 14

Now go to the Blue Iris Settings by hitting the gear in the upper left corner.

Image 15

Then navigate to the AI tab.

Currently, you can use CodeProject.AI Server from port 5000, but in the future, this will be deprecated, so change the port to 32168 and make sure the checkbox for "Use AI server on IP/port" is checked. Then hit OK.

Now that our video cam software and AI detection software are setup and working together, let's set up the Wyze cam.

Setting up your Wyze Cam

Image 16

I purchased a Wyze Cam v3 because it was the cheapest. I bought mine off of Amazon, but I believe you can purchase it at other retailers, possibly for cheaper.

Image 17

According the Quick Start Guide that comes with the camera, the first step is to download the Wyze app on your smartphone. I use an Android phone so for me, that's from the Play Store.

Image 18

The app asks you to either sign in, or make an account. I don't have one, so I hit Create Account, then enter my email, a password, agree to the terms and conditions, and enter the verification code sent to my email. Next is an option to enter a mobile phone number and set up two-factor authentication.

Next, plug the micro USB cable into the back of the Wyze cam, plug the USB cable into the adapter, and plug the adapter into the power bar.

Once the status light on the Wyze cam flashes red, the camera is ready.

Image 19

Then turn the camera upside down and open the mount to gain access to the SETUP button. Press and hold the SETUP button until a voice says, "Ready to connect." The camera keeps repeating, "ready to connect," until the device is actually paired, which is a little annoying.

Image 20

Next, go back to the Wyze app and hit New Device. Then from the Categories menu, select Cameras > Wyze Cam v3.

Image 21

The app says to plug the Wyze Cam v3 into a power outlet, (which I already did) and then check the box that reads, "I heard, 'Ready to connect'."

Image 22

The Wyze app requires location services enabled, so at this stage when it asks to select your WiFi network, a permissions window pops up and so you can enable location. Enabling location automatically selects your WiFi network name, after which you can enter the WiFi password.

Image 23

Next, take the Wyze Cam and point it at your app screen. Even though there's a diagram, I was initially confused about this and tried to get my phone to scan the QR code on the back of the Wyze Cam. Don't do that. Once you point the camera at app screen, the device connects and you can name it.

Image 24

I call my cam, "Eye Spy".

In the next step, the app asks you what you will use the device for. There wasn't an AI detection option, so I selected "Something Else."

Image 25

The Wyze app offers a subscription service called Cam Plus. I tried to look up their home page in FireFox and it crashed FireFox twice, so I'm not going to link it here. Suffice to say, Cam Plus offers premium services like Person Detection, Package Detection, Vehicle Detection, and Pet Detection, etc. for a monthly fee of $1.67 /mo, per camera. But the Basic Plan is free and it's all that is required to use the Wyze Cam.

Image 26

The Wyze app then asks if you want to share the device with Family and Friends. I don't want to do that so select, "Maybe later."

Image 27

Next is a popup to install new firmware. We actually want to use a "deprecated" firmware, so hit Cancel.

Image 28

The Wyze app then runs through a series of quick start buttons, including HD, Sound, Speak, Record, and Album buttons. It also offers, a "Pinch to zoom" so you can zoom in on what the camera sees.

Image 29

And done! The Wyze cam is set up in the Wyze app.

Now the Wyze Cam is working, but it has the wrong firmware for our purposes. It seems that at one time, Wyze offered RTSP (Real Time Streaming Protocol) functionality, but has since removed it. However, the firmware is still available online. You can download the firmware for a Wyze Cam v3 here (and for good measure, I've included a link to the firmware for a Wyze Cam v2, and the Wyze Cam Pan):

This is where you need the microSD and microSD reader. In order to update the firmware on your Wyze Cam v3, you have to shove a microSD with the firmware loaded on it, inside the camera itself. There is an article on Wyze's support site that details this, but I'll walk you through it.

Image 30

Take your microSD card and plug it into your microSD reader, then into your USB drive. Take the zip file demo_v3_RTSP_4.61.0.1.zip and copy it onto the microSD folder, and extract the zip there. Again, I'm using Winzip because I hate myself, but you can use whichever compression software you want. This extracts the file demo_wcv3.bin. Leave that file there and delete demo_v3_RTSP_4.61.0.1.zip.

Image 31

Now remove the microSD card and get your Wyze Cam v3. Unplug the USB cable if it is connected. Next to the SETUP button, there's a slot for a microSD card that's covered by a small piece of rubber. Remove this rubber to reveal the slot. On my Wyze Cam v3 there's actually a tiny diagram that shows which way to insert the microSD card. Don't shove the microSD card in the wrong way like I did, because it is difficult to take out. A microSD card only has an indentation on one side, so if you follow the diagram, there's only one way to insert it. When you push it in, there is a springy click, so that when you push the microSD card in again, it will eject.

This next part is a little tricky. Hold down the SETUP button on the Wyze Cam v3 while plugging in the USB cable to connect the Wzye Cam v3 to the outlet. Continue to hold the SETUP button. The camera light turns purple, then blue. Once the light is blue, release the SETUP button. Wait 3-4 minutes.

Image 32

Now go back to your Wyze app and select your camera. From the camera settings, go to Advanced settings. If you scroll down to the bottom, you can see RTSP.

Image 33

Once you toggle RTSP on, you get the chance to generate a username and password for accessing RTSP. This is what will be used to connect your Wyze Cam v3 to Blue Iris. Make sure both the username and password are four to ten characters long. Then hit Generate URL. This will produce an RTSP URL needed for the next section.

That's it! Now the Wyze Cam is set up and we have everything we need to get it working with Blue Iris and CodeProject.AI Server.

Getting the Wyze Cam Working with Blue Iris

Image 34

The first step is to setup the Wyze Cam with Blue Iris. Since Blue Iris is designed to work with a camera, this setup is relatively easy. Simply right-click in the main area of Blue Iris or hit the "+" symbol in the upper right-hand corner.

Image 35

This pops up the New camera dialog. From here, you can enter the Full name of your camera, and the Short name. The full name doesn't have to be the name you set up for your Wyze Cam, this is simply what Blue Iris will call it.

I call mine "Eye Spy" and "Spy1". Hit OK. This brings up a Network IP camera configuration.

Image 36

First, you need to change the http dropdown to rtsp://. Then type in the rtsp:// address from your Wyze app. It looks something like rtsp://username:pasword@10.0.0.299. After you finish typing the address, the Username and Password will automatically populate in the settings. Hit OK.

Image 37

Then from the Video tab, change the Max rate to 333333 [30 fps].

Image 38

And that's it! The Wyze Cam v3 is officially working in Blue Iris.

Detecting an Object with Blue Iris and CodeProject.AI Server

Now it's finally time for some object detection. I don't want to point my camera outside (because my wife isn't keen on that idea), so I'm limited to what is inside my room. And that's me, and my dog.

When CodeProject.AI Server was released in January 2022, it wasn't designed from the get-go to work with Blue Iris. But over time, Blue Iris became more deeply integrated with CodeProject.AI Server. Now CodeProject.AI Server is a part of the Blue Iris startup, some of the settings required to use CodeProject.AI Server are part of Blue Iris, and CodeProject.AI Server is considered the default AI service by Blue Iris team.

Still, that means (at the time of writing this article) both the Blue Iris team and CodeProject.AI Server developers are still trying to make the union between the two projects more smooth and user friendly. Perhaps, as you read this article, the settings shown look different. Or, perhaps you're running a different camera or stream, or have different needs than this article provides.

If you are stuck in any part of the Blue Iris CodeProject.AI Server integration process, I highly recommend the following resources:

  • CodeProject.AI Server Discussion thread - This is ground zero for CodeProject.AI Server development. If you have a question, or a complaint, or a feature request, please share it here. The developers are wholeheartedly dedicated in making CodeProject.AI Server better, and they definitely want to hear you.
  • ipcamtalk Forum on Blue Iris - There is a magical thread here that is several pages long that contains the long history of users working with Blue Iris and CodeProject.AI Server. If you have a Blue Iris setting or problem you can't sort, they will help you sort it. Specifically, the thread 5.5.8 - June 13, 2022 - CodeProject.AI Server. You can start reading that thread from the beginning to see the entire history of Blue Iris and CodeProject.AI Server integration, but take care in what advice / settings you decide to implement if you start from the first page. Blue Iris and CodeProject.AI Server integration have changed a lot in just a few months.
  • Blue Iris Forums - This is also a great resource if you have more Blue Iris-centered questions.

Image 39

To set up detection for a person or dog, start with the Blue Iris settings, in the AI tab.

The IP should be filled in by default. For me, this was 127.0.0.1. I've seen others put in localhost and that works too. What matters most here is that CodeProject.AI Server launches successfully. Next, because I want to detect a person or a dog, I want to use a custom model. Mike Lud is a Community Engineer for CodeProject and is at the forefront Blue Iris and CodeProject.AI Server integration, and several custom models for object detection like the Automated Licence Plate Recognition (ALPR) model. His custom models for CodeProject.AI Server are available on his GitHub. His models at the time of writing this article are:

  • IPcam-combined Labels: - person, bicycle, car, motorcycle, bus, truck, bird, cat, dog, horse, sheep, cow, bear, deer, rabbit, raccoon, fox, skunk, squirrel, pig
  • IPcam-general Labels (includes dark models images): - person, vehicle
  • IPcam-animal Labels: - bird, cat, dog, horse, sheep, cow, bear, deer, rabbit, raccoon, fox, skunk, squirrel, pig
  • IPcam-dark Labels: - Bicycle, Bus, Car, Cat, Dog, Motorcycle, Person

These models are excellent, so I will use them to detect my dog and I. Because these are custom models, they are in the following folder, which must be selected after checking the box "Use custom model folder": C:\Program Files\CodeProject\AI\modules\ObjectDetectionYolo\custom-models.

Because my graphics card is old and doesn't support NVIDIA, I am leaving the "CUDA" box unchecked. If your graphics card does support NVIDIA and you want to enable GPU support, you need to download this cuDNN install script for Windows. My system runs purely on the CPU.

Image 40

At this point, click on "Open AI control panel" to open CodeProject.AI Server in your browser. If the setup is correct, this page opens. If the setup is wrong, it does not.

Image 41

Because I'm only looking to detect a person and a dog (and because my poor little computer can only handle so much), I don't need things like the Background Remover. So switch these off by right-clicking on the three dots, then selecting Stop. As a side note, don't run YOLO detection and .NET detection at the same time. Just pick one.

Leave the CodeProject.AI Server tab open.

Image 42

Next open the camera settings and go to the Trigger tab.

Because I read the entirety of the CodeProject.AI Server thread on ipcamstalk, under the "When triggered" box, I changed "Add to alerts list" to "Hi-res JPEG files". But I don't know if that's necessary. Also, under Break time, change "End trigger unless re-triggered within" to 20 seconds, and "Maximum trigger/alert duration" to 60 seconds. Not sure if that's optimal, but it works for me.

Image 43

Then configure the Motion sensor settings. This menu is accessible by clicking on "Configure" next to the Motion sensor source while on the Trigger tab. The defaults of the motion sensor might be fine, but from my reading on the ipcamtalk forum, change the "Min. object size" to 442, and the "Min. contrast" size to 40. Hit OK.

Image 44

Within the Trigger tab, click on "Artificial Intelligence" to open the AI tab.

Ensure that CodeProject.AI or DeepStack is selected (it should be). In the "To confirm" box, type "person,dog" with no space between the comma and dog. In the "To cancel" box, put in something that the model doesn't detect, like giraffe. This is completely uncorroborated, but a user on the ipcamtalk forum indicated that your AI service "will stop processing images as soon as it finds something in your 'To Confirm box'." Other users don't have anything in this box in their settings, so it's probably not necessary. Looking above, the model that detects both persons and dogs is the ipcam-combined model, so put that into the box. And the great Mike Lud himself sets his "min confidence" to 50%, his "+ real-time images" to 10, and his "analyze one of each" to 500 ms, so this is gospel. Hit OK.

Image 45

This Alerts tab still has default settings (I think), but just in case, this is my Alerts tab in my camera settings.

Image 46

Now navigate over to the Blue Iris Status tab. This is where we check to see if object detection works.

Image 47

Go to the Log, and within that tab is a list of events and alerts. Because the camera is pointed at me, I move slightly, watch the log, and see it says, "AI: [ipcam-combined] person: 86% [724,275 1647,1061] 136 ms".

That's it! AI detection is working!

But that's just me. What about my dog?

For this next part, I look at AI detection on a video source, rather than just looking at a log.

Image 48

First, go to the "Record Start/Stop" button on the camera display and click it to start recording. Click the button again to stop it. My camera continuously stays on and records once it is activated, so there is only one clip on my list. The recording shows up in the clip menu on the left.

Image 49

From the All clips sidebar, double-click on the recording clip you want, which opens up the video stream. This loads the stream as a video, which you can scroll through.

Image 50

The next step is to ensure Testing and Tuning is active. On the video screen, right-click, go to Testing & Tuning, and make sure "Analyze with AI" is checked. Now the stream of video shows detection boxes that indicate what is being detected on video playback.

Image 51

And voilà! Dog detected!

Hopefully, that walks you through getting started with Blue Iris, CodeProject.AI Server, and object detection with a Wyze Cam v3. Please let me know if you have any questions in the comments below.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Writer CodeProject
Canada Canada
Sean Ewington is the Content Manager for CodeProject.

His background in programming is primarily C++ and HTML, but has experience in other, "unsavoury" languages.

He loves movies, and likes to say inconceivable often, even if it does not mean what he thinks it means.

Comments and Discussions

 
QuestionAI server clarification Pin
Member 319178130-Sep-23 11:08
Member 319178130-Sep-23 11:08 
AnswerRe: AI server clarification Pin
Sean Ewington2-Oct-23 5:39
staffSean Ewington2-Oct-23 5:39 
QuestionIssues Installing Firmware Pin
Karl Wooster3-May-23 19:10
Karl Wooster3-May-23 19:10 
AnswerRe: Issues Installing Firmware Pin
Sean Ewington4-May-23 13:01
staffSean Ewington4-May-23 13:01 
PraiseAwesome, thank you! Pin
Sym0nd09-Feb-23 19:15
Sym0nd09-Feb-23 19:15 
GeneralRe: Awesome, thank you! Pin
Sean Ewington10-Feb-23 5:13
staffSean Ewington10-Feb-23 5:13 
QuestionThanks! Pin
shadsnz25-Nov-22 8:42
shadsnz25-Nov-22 8:42 
AnswerRe: Thanks! Pin
Sean Ewington27-Nov-22 3:56
staffSean Ewington27-Nov-22 3:56 
QuestionGreat Writeup Pin
Mike Lud16-Nov-22 18:33
communityengineerMike Lud16-Nov-22 18:33 
AnswerRe: Great Writeup Pin
Sean Ewington17-Nov-22 5:32
staffSean Ewington17-Nov-22 5:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.