From b3c1142a3025a7ff4727ca941e4f57e57ae32e34 Mon Sep 17 00:00:00 2001 From: Lateefah Bello <2019cinnamon@gmail.com> Date: Tue, 6 Jul 2021 16:05:51 +0100 Subject: [PATCH] chapter 5 (#162) * Update README.md * chapter 4 (lesson one) * chapter 4 (lesson 2&4) * Update pi-camera.md * Update pi-proximity.md * chapter 5 * fix Co-authored-by: Jim Bennett --- 5-retail/README.md | 2 +- 5-retail/lessons/1-train-stock-detector/README.md | 2 +- 5-retail/lessons/2-check-stock-device/README.md | 4 ++-- .../pi/{fruit-quality-detector => stock-counter}/app.py | 0 .../{fruit-quality-detector => stock-counter}/app.py | 0 .../{fruit-quality-detector => stock-counter}/.gitignore | 0 .../.vscode/extensions.json | 0 .../{fruit-quality-detector => stock-counter}/include/README | 0 .../{fruit-quality-detector => stock-counter}/lib/README | 0 .../{fruit-quality-detector => stock-counter}/platformio.ini | 0 .../{fruit-quality-detector => stock-counter}/src/camera.h | 0 .../{fruit-quality-detector => stock-counter}/src/config.h | 0 .../{fruit-quality-detector => stock-counter}/src/main.cpp | 0 .../{fruit-quality-detector => stock-counter}/test/README | 0 .../pi/{fruit-quality-detector => stock-counter}/app.py | 0 .../{fruit-quality-detector => stock-counter}/app.py | 0 .../{fruit-quality-detector => stock-counter}/.gitignore | 0 .../.vscode/extensions.json | 0 .../{fruit-quality-detector => stock-counter}/include/README | 0 .../{fruit-quality-detector => stock-counter}/lib/README | 0 .../{fruit-quality-detector => stock-counter}/platformio.ini | 0 .../{fruit-quality-detector => stock-counter}/src/camera.h | 0 .../{fruit-quality-detector => stock-counter}/src/config.h | 0 .../{fruit-quality-detector => stock-counter}/src/main.cpp | 0 .../{fruit-quality-detector => stock-counter}/test/README | 0 .../2-check-stock-device/single-board-computer-count-stock.md | 4 ++-- .../single-board-computer-object-detector.md | 2 +- 6-consumer/README.md | 4 ++-- 6-consumer/lessons/1-speech-recognition/README.md | 2 +- 29 files changed, 10 insertions(+), 10 deletions(-) rename 5-retail/lessons/2-check-stock-device/code-count/pi/{fruit-quality-detector => stock-counter}/app.py (100%) rename 5-retail/lessons/2-check-stock-device/code-count/virtual-iot-device/{fruit-quality-detector => stock-counter}/app.py (100%) rename 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/{fruit-quality-detector => stock-counter}/.gitignore (100%) rename 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/{fruit-quality-detector => stock-counter}/.vscode/extensions.json (100%) rename 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/{fruit-quality-detector => stock-counter}/include/README (100%) rename 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/{fruit-quality-detector => stock-counter}/lib/README (100%) rename 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/{fruit-quality-detector => stock-counter}/platformio.ini (100%) rename 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/{fruit-quality-detector => stock-counter}/src/camera.h (100%) rename 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/{fruit-quality-detector => stock-counter}/src/config.h (100%) rename 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/{fruit-quality-detector => stock-counter}/src/main.cpp (100%) rename 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/{fruit-quality-detector => stock-counter}/test/README (100%) rename 5-retail/lessons/2-check-stock-device/code-detect/pi/{fruit-quality-detector => stock-counter}/app.py (100%) rename 5-retail/lessons/2-check-stock-device/code-detect/virtual-iot-device/{fruit-quality-detector => stock-counter}/app.py (100%) rename 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/{fruit-quality-detector => stock-counter}/.gitignore (100%) rename 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/{fruit-quality-detector => stock-counter}/.vscode/extensions.json (100%) rename 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/{fruit-quality-detector => stock-counter}/include/README (100%) rename 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/{fruit-quality-detector => stock-counter}/lib/README (100%) rename 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/{fruit-quality-detector => stock-counter}/platformio.ini (100%) rename 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/{fruit-quality-detector => stock-counter}/src/camera.h (100%) rename 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/{fruit-quality-detector => stock-counter}/src/config.h (100%) rename 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/{fruit-quality-detector => stock-counter}/src/main.cpp (100%) rename 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/{fruit-quality-detector => stock-counter}/test/README (100%) diff --git a/5-retail/README.md b/5-retail/README.md index c5a2e4c..c2b9198 100644 --- a/5-retail/README.md +++ b/5-retail/README.md @@ -8,7 +8,7 @@ IoT can help with this, using AI models running on IoT devices to count stock, u In these 2 lessons you'll learn how to train image-based AI models to count stock, and run these models on IoT devices. -> 💁 These lessons will use some cloud resources. If you don't complete all the lessons in this project, make sure you [Clean up your project](../clean-up.md). +> 💁 These lessons will use some cloud resources. If you don't complete all the lessons in this project, make sure you [clean up your project](../clean-up.md). ## Topics diff --git a/5-retail/lessons/1-train-stock-detector/README.md b/5-retail/lessons/1-train-stock-detector/README.md index 7516434..e9dbdcb 100644 --- a/5-retail/lessons/1-train-stock-detector/README.md +++ b/5-retail/lessons/1-train-stock-detector/README.md @@ -105,7 +105,7 @@ You can train an object detector using Custom Vision, in a similar way to how yo Call your project `stock-detector`. - When you create your project, make sure to use the `stock-detector-training` resource you created earlier. Use a n*Object Detection* project type, and the *Products on Shelves* domain. + When you create your project, make sure to use the `stock-detector-training` resource you created earlier. Use *Object Detection* project type, and the *Products on Shelves* domain. ![The settings for the custom vision project with the name set to fruit-quality-detector, no description, the resource set to fruit-quality-detector-training, the project type set to classification, the classification types set to multi class and the domains set to food](../../../images/custom-vision-create-object-detector-project.png) diff --git a/5-retail/lessons/2-check-stock-device/README.md b/5-retail/lessons/2-check-stock-device/README.md index f69a58b..2ce36dc 100644 --- a/5-retail/lessons/2-check-stock-device/README.md +++ b/5-retail/lessons/2-check-stock-device/README.md @@ -116,7 +116,7 @@ You can use bounding boxes combined with probabilities to evaluate how accurate ![Two bonding boxes overlapping a can of tomato paste](../../../images/overlap-object-detection.png) -In the example above, one bounding box indicated a predicted can of tomato paste at 78.3%. A second bounding box is slightly smaller, and is inside the first bounding box with a probability of 64.3%. You code can check the bounding boxes, see they overlap completely, and ignore the lower probability as there is no way one can can be inside another. +In the example above, one bounding box indicated a predicted can of tomato paste at 78.3%. A second bounding box is slightly smaller, and is inside the first bounding box with a probability of 64.3%. Your code can check the bounding boxes, see they overlap completely, and ignore the lower probability as there is no way one can can be inside another. ✅ Can you think of a situation where is it valid to detect one object inside another? @@ -157,7 +157,7 @@ Follow the relevant guide below to count stock using the results from the object Can you detect incorrect stock? Train your model on multiple objects, then update your app to alert you if the wrong stock is detected. -Maybe even take this further and detect stock side by side on the same shelf, and see if something has been put in the wrong place bu defining limits on the bounding boxes. +Maybe even take this further and detect stock side by side on the same shelf, and see if something has been put in the wrong place by defining limits on the bounding boxes. ## Post-lecture quiz diff --git a/5-retail/lessons/2-check-stock-device/code-count/pi/fruit-quality-detector/app.py b/5-retail/lessons/2-check-stock-device/code-count/pi/stock-counter/app.py similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-count/pi/fruit-quality-detector/app.py rename to 5-retail/lessons/2-check-stock-device/code-count/pi/stock-counter/app.py diff --git a/5-retail/lessons/2-check-stock-device/code-count/virtual-iot-device/fruit-quality-detector/app.py b/5-retail/lessons/2-check-stock-device/code-count/virtual-iot-device/stock-counter/app.py similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-count/virtual-iot-device/fruit-quality-detector/app.py rename to 5-retail/lessons/2-check-stock-device/code-count/virtual-iot-device/stock-counter/app.py diff --git a/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/.gitignore b/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/.gitignore similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/.gitignore rename to 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/.gitignore diff --git a/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/.vscode/extensions.json b/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/.vscode/extensions.json similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/.vscode/extensions.json rename to 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/.vscode/extensions.json diff --git a/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/include/README b/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/include/README similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/include/README rename to 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/include/README diff --git a/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/lib/README b/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/lib/README similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/lib/README rename to 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/lib/README diff --git a/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/platformio.ini b/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/platformio.ini similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/platformio.ini rename to 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/platformio.ini diff --git a/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/src/camera.h b/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/src/camera.h similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/src/camera.h rename to 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/src/camera.h diff --git a/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/src/config.h b/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/src/config.h similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/src/config.h rename to 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/src/config.h diff --git a/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/src/main.cpp b/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/src/main.cpp similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/src/main.cpp rename to 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/src/main.cpp diff --git a/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/test/README b/5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/test/README similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/fruit-quality-detector/test/README rename to 5-retail/lessons/2-check-stock-device/code-count/wio-terminal/stock-counter/test/README diff --git a/5-retail/lessons/2-check-stock-device/code-detect/pi/fruit-quality-detector/app.py b/5-retail/lessons/2-check-stock-device/code-detect/pi/stock-counter/app.py similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-detect/pi/fruit-quality-detector/app.py rename to 5-retail/lessons/2-check-stock-device/code-detect/pi/stock-counter/app.py diff --git a/5-retail/lessons/2-check-stock-device/code-detect/virtual-iot-device/fruit-quality-detector/app.py b/5-retail/lessons/2-check-stock-device/code-detect/virtual-iot-device/stock-counter/app.py similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-detect/virtual-iot-device/fruit-quality-detector/app.py rename to 5-retail/lessons/2-check-stock-device/code-detect/virtual-iot-device/stock-counter/app.py diff --git a/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/.gitignore b/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/.gitignore similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/.gitignore rename to 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/.gitignore diff --git a/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/.vscode/extensions.json b/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/.vscode/extensions.json similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/.vscode/extensions.json rename to 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/.vscode/extensions.json diff --git a/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/include/README b/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/include/README similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/include/README rename to 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/include/README diff --git a/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/lib/README b/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/lib/README similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/lib/README rename to 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/lib/README diff --git a/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/platformio.ini b/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/platformio.ini similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/platformio.ini rename to 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/platformio.ini diff --git a/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/src/camera.h b/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/src/camera.h similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/src/camera.h rename to 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/src/camera.h diff --git a/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/src/config.h b/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/src/config.h similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/src/config.h rename to 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/src/config.h diff --git a/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/src/main.cpp b/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/src/main.cpp similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/src/main.cpp rename to 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/src/main.cpp diff --git a/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/test/README b/5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/test/README similarity index 100% rename from 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/fruit-quality-detector/test/README rename to 5-retail/lessons/2-check-stock-device/code-detect/wio-terminal/stock-counter/test/README diff --git a/5-retail/lessons/2-check-stock-device/single-board-computer-count-stock.md b/5-retail/lessons/2-check-stock-device/single-board-computer-count-stock.md index a6a627d..78f2d6d 100644 --- a/5-retail/lessons/2-check-stock-device/single-board-computer-count-stock.md +++ b/5-retail/lessons/2-check-stock-device/single-board-computer-count-stock.md @@ -80,7 +80,7 @@ In the image shown above, the bounding boxes have a small overlap. If this overl ### Task - count stock ignoring overlap -1. The Pip package [Shapely](https://pypi.org/project/Shapely/) can be used to calculate the intersection. If you are using a Raspberry Pi, you will need to instal a library dependency first: +1. The Pip package [Shapely](https://pypi.org/project/Shapely/) can be used to calculate the intersection. If you are using a Raspberry Pi, you will need to install a library dependency first: ```sh sudo apt install libgeos-dev @@ -158,6 +158,6 @@ In the image shown above, the bounding boxes have a small overlap. If this overl 1. Run the app with the camera pointing at some stock on a shelf. The output will indicate the number of bounding boxes without overlaps that exceed the threshold. Try adjusting the `overlap_threshold` value to see predictions being ignored. -> 💁 You can find this code in the [code-count/pi](code-count/pi) or [code-count/virtual-device](code-count/virtual-device) folder. +> 💁 You can find this code in the [code-count/pi](code-count/pi) or [code-count/virtual-iot-device](code-count/virtual-iot-device) folder. 😀 Your stock counter program was a success! diff --git a/5-retail/lessons/2-check-stock-device/single-board-computer-object-detector.md b/5-retail/lessons/2-check-stock-device/single-board-computer-object-detector.md index 4976046..45b6cca 100644 --- a/5-retail/lessons/2-check-stock-device/single-board-computer-object-detector.md +++ b/5-retail/lessons/2-check-stock-device/single-board-computer-object-detector.md @@ -69,6 +69,6 @@ The code you used to classify images is very similar to the code to detect objec ![4 cans of tomato paste on a shelf with predictions for the 4 detections of 35.8%, 33.5%, 25.7% and 16.6%](../../../images/custom-vision-stock-prediction.png) -> 💁 You can find this code in the [code-detect/pi](code-detect/pi) or [code-detect/virtual-device](code-detect/virtual-device) folder. +> 💁 You can find this code in the [code-detect/pi](code-detect/pi) or [code-detect/virtual-iot-device](code-detect/virtual-iot-device) folder. 😀 Your stock counter program was a success! diff --git a/6-consumer/README.md b/6-consumer/README.md index 62a89c3..4b986ad 100644 --- a/6-consumer/README.md +++ b/6-consumer/README.md @@ -1,12 +1,12 @@ # Consumer IoT - build a smart voice assistant -The fod has been grown, driven to a processing plant, sorted for quality, sold in the store and now it's time to cook! One of the core pieces of any kitchen is a timer. Initially these started as hour glasses - your food was cooked when all the sand trickled down into the bottom bulb. They then went clockwork, then electric. +The food has been grown, driven to a processing plant, sorted for quality, sold in the store and now it's time to cook! One of the core pieces of any kitchen is a timer. Initially these started as hour glasses - your food was cooked when all the sand trickled down into the bottom bulb. They then went clockwork, then electric. The latest iterations are now part of our smart devices. In kitchens in homes all throughout the world you'll hear cooks shouting "Hey Siri - set a 10 minute timer", or "Alexa - cancel my bread timer". No longer do you have to walk back to the kitchen to check on a timer, you can do it from your phone, or a call out across the room. In these 4 lessons you'll learn how to build a smart timer, using AI to recognize your voice, understand what you are asking for, and reply with information about your timer. You'll also add support for multiple languages. -> 💁 These lessons will use some cloud resources. If you don't complete all the lessons in this project, make sure you [Clean up your project](../clean-up.md). +> 💁 These lessons will use some cloud resources. If you don't complete all the lessons in this project, make sure you [clean up your project](../clean-up.md). ## Topics diff --git a/6-consumer/lessons/1-speech-recognition/README.md b/6-consumer/lessons/1-speech-recognition/README.md index 69875d7..3088707 100644 --- a/6-consumer/lessons/1-speech-recognition/README.md +++ b/6-consumer/lessons/1-speech-recognition/README.md @@ -16,7 +16,7 @@ This video gives an overview of the Azure speech service, a topic that will be c 'Alexa, timer status' -'Alexa set a 8 minute timer called steam broccoli' +'Alexa, set a 8 minute timer called steam broccoli' Smart devices are becoming more and more pervasive. Not just as smart speakers like HomePods, Echos and Google Homes, but embedded in our phones, watches, and even light fittings and thermostats.