Categories
TUTORIALS

ESP32-CAM real time Object detection


# 1 Project Description

There are some urban problems that can be solved quickly by “observing” certain events. Representative examples are ‘garbage dumping’ and ‘illegal parking’, most of which are currently solved with limited budgets and limited personnel. In addition, in order to analyze the correlation between specific problems and specific factors, we need “observation” data. A typical example would be ‘foot traffic analysis’. This project is largely designed to solve these problems, proving that it is possible to design a low-cost device that can identify objects in real-time using cameras and deep learning models. Furthermore, we want to use it to enable real-time “observation” of littering in a community garden in Philadelphia.


# 2 Higher overview

  • 1. connect camera with wifi
  • 2. write code to upload image on server
  • 3. write code for detecting object using image on the server

# 3 Parts list


# 4 Wire Parts


# 5 Install Board Manager

  • 1. Add this “https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json” to File > Preferences > Additional Board Manager URL
  • 2. Open Board Manager (Tools > Board > Board Manager) and install esp32 library

# 6 Install Library

  • 1. Go to this github and download library as zip file
  • 2. Install library (Sketch > Include library > Add zip file)

# 7 Upload code to ESP32

Attention : this is the most tricky part

  • 1. copy below code to your arduino IDE and change wifi_ssid, wifi_pass of yours.
  • 2. connect I01 and GND of ESP32-CAM before uploading code
  • 3. connect module with computer and check your FTDI’s port
  • 4. set your board as ESP32 Wrover Module
  • 5. set your port of your FTDI
  • 6. set your frequency to 80hz
  • 7. set your partition scheme like below
  • 8. set upload speed like below
  • 9. code upload done
  • 10. disconnect I01 and GND of ESP32-CAM before uploading code
  • 11. push reset button to run your code
  • 12. check your serial monitor 115200 band

# 8 Run Object detection code

  • 1. copy below python code
  • 2. download below three file and locate them within same folder with your python code

ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt

frozen_inference_graph.pb

coco.names

  • 3. change code url using current serial monitor url
  • 4. Let’s detect object!

My room detection example


References

  • https://diyprojectslab.com/esp32-cam-object-detection-using-opencv-python/
  • https://how2electronics.com/esp32-cam-based-object-detection-identification-with-opencv/
  • https://www.electronicsforu.com/electronics-projects/hardware-diy/object-detection-using-esp32-cam
  • https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4152378

One reply on “ESP32-CAM real time Object detection”

Nice project!

I get the following syntaxerror:

classNames = []
^
SyntaxError: invalid syntax

What should classNames equal to …??

Leave a Reply

Your email address will not be published. Required fields are marked *