Image

Living in the Edge of AI

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!

Advertisements
Image

DIY: Smart Fridge

Objective: Turn your refrigerator into a Smart Home IoT device

What you need: Raspberry Pi 3 Model B, with Raspbian OS, Camera Module, Bluetooth Speaker, USB LED Light, Power Bank

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.

Screen Shot 2018-01-26 at 7.09.52 PM

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.

What’s Next:

Build some Alexa Skills so you can access your Raspberry Pi device from Alexa Echo. Ask Alexa “Hey Alexa, what’s in my fridge?”

Image

SPiCam: Raspberry Pi Surveillance Camera

Objective: Build a video surveillance camera on Raspberry Pi

What you’ll need: Raspberry Pi 3 with Raspbian OS, Camera Module, RaspiCam Remote mobile app

Step 1: Connect the Camera Module to your Raspberry Pi device

20180125_164852

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.

Screen Shot 2018-01-25 at 4.52.13 PM

Screen Shot 2018-01-25 at 4.52.34 PM

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.

20180126_123238

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.

Screenshot_20180125-163346

Step 8: Done! Watch the live video stream coming from your Raspberry Pi’s camera on your mobile phone.

Screenshot_20180125-142942

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!

AI Powered Smart Homes and Kitchens

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.

Image

RaspberryPi – Media Player

Objective – Build a touch-screen multimedia display for car in 3 simple steps:

What you need – Raspberry Pi, Touch Screen Display, Micro SD Card

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.

Image

Datasets


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.

See the Sony project on Artist Relation Extraction, or my git repository on Information Extraction from Wikipedia.

FRIENDS Data – contains full episodes and scripts from FRIENDS tv-show used in our Humor Analysis research paper.