From 7270977cfb7fc7b9fd64916f11e92745cc0d4bcf Mon Sep 17 00:00:00 2001 From: Lateefah Bello <2019cinnamon@gmail.com> Date: Tue, 6 Jul 2021 09:37:29 +0100 Subject: [PATCH] chapter 5 --- 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 +- 26 files changed, 6 insertions(+), 6 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/lessons/1-train-stock-detector/README.md b/5-retail/lessons/1-train-stock-detector/README.md index 7516434f..e9dbdcbc 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 f69a58bc..2ce36dcb 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 a6a627da..78f2d6de 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 49760468..45b6cca0 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!