How AI is shaping the world around us.. Read my article on “Living in the Edge of AI” discussing Digital Trends in AI, Robotics, IoT and Edge Computing!
Objective: Turn your refrigerator into a Smart Home IoT device
Step 1: Hardware Setup
To avoid changing any built-in electric wiring in the fridge, I used a power bank to supply power to the Raspberry Pi device, and a USB LED light to provide lighting for camera, when the door is closed.
Connect your Raspberry Pi device to external speaker using bluetooth or audio cable. Connect the camera module to Raspberry Pi. Connect the LED light to Raspberry Pi through USB. Connect your Raspberry Pi device to a power bank.
The setup looks something like this, where all the external components except for the bluetooth speaker (camera, battery, LED light) are connected physically to the Raspberry Pi device.
Place the device in the fridge or kitchen cabinet so that the camera is pointing in the direction of the items inside.
Step 2: Remote Access
Get your Raspberry Pi device’s IP address and connect from your mobile phone using the RaspiCam-Remote mobile app. Make sure you are able to view the inside of your fridge or kitchen cabinet on your mobile phone. Check my previous blog post on how to access the Pi camera on mobile phone.
Step 3: Image Recognition & Voice
I have uploaded a python script Smart-Fridge.py in my git repository under Smart-Home. This script takes a snapshot image with Pi camera, performs image recognition using AWS Rekognition API, prints the list of items found in the image on STDOUT, and also produces audio output using the Text-to-Speech API of AWS Polly, which is played on the external speaker connected to Raspberry Pi via bluetooth. The script can be run remotely from any computer connected to the Raspberry Pi device via VNC or SSH.
Objective: Build a video surveillance camera on Raspberry Pi
Step 1: Connect the Camera Module to your Raspberry Pi device
Step 2: Install python library pi-camera using:
sudo apt-get install python-picamera
Step 3: In Raspberry Pi Configuration Settings under Preferences, make sure the Camera and SSH options are enabled.
It is also recommended that you change your default system password in settings.
Step 4: Test the camera module by running the following python script:
import picamera from time import sleep camera = picamera.PiCamera() camera.vflip=True camera.start_preview(fullscreen=True) sleep(30) camera.stop_preview()
The above python script should display the video stream from your Pi camera on the monitor or TV screen directly connected to your Raspberry Pi device through HDMI cable.
Step 5: Download and install the app RaspiCam Remote on your mobile phone.
Step 6: Get your Raspberry Pi device’s IP address using ifconfig command
Normally, the IP address looks like 192.168.1.XXX
Step 7: Connect to your Pi camera remotely from your mobile phone, with the RaspiCam Remote app. Unless you have changed the default options in raspi-config settings, username = pi, password = raspberry, and port = 22.
Step 8: Done! Watch the live video stream coming from your Raspberry Pi’s camera on your mobile phone.
Note: If you have downloaded vnc-server on your Raspberry Pi, you can connect to your Raspberry Pi device remotely from your laptop with VNC Viewer. However, due to display overlap issues, the camera stream will not be visible on remote computer.
Step 9: Record videos to watch later.
import picamera from time import sleep camera = picamera.PiCamera() camera.vflip=True camera.resolution = (640,480) camera.start_recording('output-video.h264') sleep(60) camera.stop_recording()
The above python script will record 1 min video and save it in file output-video.h264
Next Steps: Add some code on your Raspberry Pi for motion detection or face recognition using the OpenCV library!
LG announces ThinQ AI Technology for Smart Homes where appliances are connected through Home IoT and powered with Google Assistant / Alexa along with built-in Voice / Image Recognition Technology.
The LG Smart ThinQ refrigerator comes with a panoramic view camera, so you can not only see what’s inside your refrigerator on your mobile phone or TV screen, but also receive recipe suggestions based on what’s available in your fridge. It also sends alerts when items in your fridge pass their expiry date.
Check out these awesome demos on Face Detection, Pedestrian Detection and Automated Number Plate Recognition (ANPR)..
Code Available on Github at – https://github.com/pamruta/Computer-Vision
Objective – Build a touch-screen multimedia display for car in 3 simple steps:
Step 1: Connect the SD card to your laptop or computer. Download the latest version of OSMC (open-source media center) and install it directly on the SD card. OSMC offers a linux-based operating system, that runs Kodi (media player).
Step 2: Insert the SD card (with OSMC installed) into your Raspberry Pi’s SD card slot. Attach the Raspberry Pi to touch-screen display. When you power-ON the Raspberry Pi, it directly boots via SD card, and starts the OSMC / Kodi application.
Step 3: You can either browse and play your personal media files (like audio / video / photos) via USB flash-drive, or download various add-ons (like YouTube, SoundCloud etc) for online streaming, by connecting your Raspberry Pi to WiFi network.
Note: The other alternatives to OSMC include OpenElec (Open Embedded Linux Entertainment Center) and LibreElec that exclusively run Kodi. Alternatively, you can also install Kodi on Raspbian if you need a full Raspbian OS that runs applications other than Kodi. I have created 2 SD cards – one that exclusively runs the media player with OSMC, and the other with full Raspbian OS for general programming.
Finally by popular demand, releasing two datasets –
Bollywood Data – contains full-biographies of famous actors, singers and musicians, plus plot summaries of over 400 Hindi movies from Wikipedia.