For the AMD AI Contest, I set out to tackle a common household issue using image recognition: detecting whether a dishwasher is correctly loaded or not. Perhaps you’ve encountered this problem yourself, where some family members believe in a freestyle method for loading the dishwasher, thinking it’s efficient and economical. With the dataset developed in this project, we can help these well-meaning individuals improve their dishwasher-loading skills.
Project Steps1. Issues with the Initial Setup of the Compact AMD PCAt the start, I encountered a problem where my old DVI monitor couldn’t connect to the Ryzen Mini PC using a DVI-HDMI adapter. The graphics chip in the Mini PC seemed to use different specifications than my previous office PC. This was a good opportunity to upgrade to a new monitor model. The new Dell monitor worked perfectly with the Ryzen Mini PC.
First Step: Successfully completed 😊
2. Issues with Running the AMD AI DemoBefore you can start installing the tools for the AMD AI Demo you need to enable the NPU. This is shown here (scroll down to "To Enable the NPU (also called IPU)")
https://www.hackster.io/512342/amd-pervasive-ai-developer-contest-pc-ai-study-guide-6b49d8 --> To Enable the NPU (also called IPU)
In order to run the demo we need to install a few tools (https://ryzenai.docs.amd.com/en/latest/inst.html). The initial steps, such as installing cmake and Python, were straightforward. However, the process halted when it came to installing Visual Studio 2019, which is not readily accessible to individuals without a corporate Microsoft Developer account.
But I have found a workaround at Discord:
From Discord (acharroux):
...
For those that have difficulties to get the hand on Visual Studio 2019 or are a little bit worried because it is quite old version becoming sunset
install.bat can be tricked to work with Visual Studio 2022
Just edit the install.bat
and change line
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\16.0" >nul 2>&1
to
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\17.0" >nul 2>&1
After that, I tried out the Demo, but there were some error messages regarding python libraries:
Sadly Google and other sources like Stackoverflow were not helpful with these library issues. So this step was not successful. I couldn't test the NPU and couldn't run the demo.
Second Step: Unsuccessful ☹
3. Installation of Pytorch and YOLOv8Undeterred by the AMD demo’s failure, I decided to install various Python packages, focusing on Pytorch and YOLOv8, to conduct image recognition within a Jupyter Notebook environment. The installation of Pytorch posed significant challenges and only succeeded with an older version; other configurations led to exceptions.
With this command I wasn't successful - I was getting exceptions in my Python code:
pip3 install torch torchvision torchaudio
But this one was working:
pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cpu
Third Step: Successfully completed 😊
4. Initial Trials with YOLOv8I began experimenting with YOLOv8 in the Jupyter Notebook environment.
(You can find two software code snippets: "First test - YOLOv8" and "Second test - compare the different YOLOv8-models" for Jupyter Notebooks in the attachment section).
At first I tried out a simple object detection with one YOLOv8 model:
Then I have extended my code to compare the performance of all the different models that come with YOLOv8:
Fourth Step: Successfully completed 😊
5. Creating a Custom Dataset with RoboflowAs a preliminary task for the dishwasher dataset, I labelled a small dataset with three different types of pens using Roboflow.com.
The dataset only consists of 30 images, with three classes:
- blue pen
- green pen
- orange pen
You can find the dataset here:
https://universe.roboflow.com/yolotestworkspace/stifte-qhptd
Fifth Step: Successfully completed 😊
6. Inference with the First Test DatasetI trained the small dataset in YOLOv8, but the subsequent inference did not yield the desired results. The dataset appeared to be linked with the standard YOLOv8 dataset, and I couldn’t find a viable solution to this issue.
So instead of the three classes: blue pen, green pen, and orange pen I got wrong labels in this test image.
Sixth Step: Unsuccessful ☹
7. Dataset and Inference Functions with RoboflowRoboflow not only facilitates elegant image labeling but also allows model training and inference using Roboflow's own libraries. This worked well with both the pen dataset and the dishwasher dataset created for the project.
In the next picture we can see the inference results for the pen training model, currently it comes only with 3 classes:
- blue pen (with the label: "Farbe Blau")
- green pen (with the label: "Farbe Gruen")
- orange pen (with the label: "Farbe Orange")
The dishwasher dataset includes 135 labeled images, categorized as:
- plate_misaligned
- plates_neatly_stacked
- plates_stacked_mixed
Link to Roboflow dataset visualization:Test images
Link to Roboflow dataset:Roboflow dataset
Below is a third code snippet "Third test - Dishwasher Dataset with Roboflow functions" where you can try out this model in Python code.
A very nice feature is, that you can try out the trained model directly on your smartphone browser. In this screenshot, my trained model worked pretty well.
Seventh Step: Successfully completed 😊
8. OutlookIn the future, we plan to expand our dataset by adding more images and introducing additional classes for labeling. This will improve the accuracy and versatility of our dishwasher loading detection system. Additionally, we aim to get the AMD NPU up and running to enhance processing speed and efficiency. Stay tuned as we continue to refine and advance this project!
Comments