In Order to Prevent the Dog from Getting on the Couch, a Real-time Target Recognition Feature Was written
5 min readMay 23, 2024
Background
The current situation is that there is a dog🐶 in the house, and it likes to sleep on the sofa🛋️ when people are not paying attention, and it happens that it has just moved recently + the dog has ushered in the shedding period, and does not want to let the sofa have a lot of hair. So hopefully the dog can be recognized, and then the “roll down” audio 📣 will be played.
Requirements analysis
- A camera 📷 is required
— With Chrome, you can call your phone’s camera, get permissions, and then use Video to draw the camera’s content onto video. - Identify the dog 🐶 in the frame in real time through the camera
— Leverage tensorflow and pre-trained COCO-SSD MobileNet V2 models for object detection.
— The video stream of the camera is converted into video frames and images are sent to the model for recognition. - Record an audio
— Play audio 📣 when the target (dog) is recognized. - It needs to be deployed on one device
— Find an old phone 📱 that you don’t use, Android system.
— Install Termux to enable the local HTTP service 🌐