Dish Classifier
The Dish Classifier model is designed to identify food in an image. It’s based on the MobileNet model architecture and trained to recognize over 2,000 types of food.
Demo: What’s on my plate?
Send an image to the demo and it’ll try to guess the food in the image.
What you’ll need
Assembled Vision Kit with the latest SD card image.
Step 1: Get connected
First, make sure you’re connected to your kit and have a terminal open. All the following commands must be performed on your kit's Raspberry Pi.
Step 2: Stop your current demo
Your Vision Kit might be running another demo, such as the Joy Detector, which runs by default when your kit is turned on. You can tell it's running if the green privacy LED on the front of the kit is illuminated. You can stop the Joy Detector with the following command:
sudo systemctl stop joy_detection_demo
Or if you're running another demo that uses the camera, press Control+C in the terminal to stop it.
Step 3: Find an image to use with your model
This demo requires that you pass it an image, instead of using the camera. So find an image of some food and download it with the command wget <URL>
.
For example, here's an image licensed under Creative Commons:
wget https://farm5.staticflickr.com/7284/16301478750_b036c617cb_o.jpg -O food.jpg
The file is downloaded to the current directory, named food.jpg
.
Step 4: Run the Dish Detector
Run the demo with the following command:
~/AIY-projects-python/src/examples/vision/dish_classification.py --input food.jpg
The food detector takes a guess at the food and prints its answer on your terminal screen.
Try some other photos of fruits, vegetables, or cereal. Or try just one object, like one apple, then a whole bunch of items.
Note: It takes a few moments for the demo to start because the raw image data must be transferred from the Raspberry Pi memory to the Vision Bonnet—the actual image classification happens very fast. This delay is avoided when processing images directly from the Pi Camera, as shown in the face_detection_camera.py
demo.
If you ran into an error, check Help.