Updated February 8, 2021

Some AI datasets have directories where each directory represents a class. A particular directory can contain a large number of files. Because of time and memory constrains you may want to train your model using a smaller number of files.

We detail how to move the first n files from a directory into a new directory.
This is done for each directory (class) in the dataset.

We also show how to get a random sample of n items from a directory.

The dataset “keywords” can be downloaded from:
https://docs.edgeimpulse.com/docs/keyword-spotting

I created a folder, “Dataset” on my…


Introduction

When you purchase a Raspberry Pi 4, you will need some additional items to make it operational. These include: 1) monitor, 2) keyboard, 3) mouse, 4) power supply, 5) HDMI cable to connect to the monitor, and 6) an operating system (Raspbian Buster) on a micro SD card.

Purchases

From: Pimoroni Ltd. https://shop.pimoroni.com/products/raspberry-pi-4?variant=29157087445075
Raspberry Pi 4–4GB RAM (1 GB and 2 GB models are also available.)

From Staples: https://www.staples.com/dell-23-monitor-e2318hr/product_2767069
Dell E Model E2318HR 23" LED Monitor, Black (Similar HDMI monitors are ok.)

From: Adafruit: https://www.adafruit.com/product/4112
Official Raspberry Pi Keyboard — Black and Gray

From Adafruit: https://www.adafruit.com/product/4113


Introduction

When you purchase a Raspberry Pi, you will need some additional items to make it operational. These include: 1) monitor, 2) keyboard, 3) mouse, 4) power supply, 5) HDMI cable to connect to the monitor, and 6) an operating system (Raspbian Stretch) on a micro SD card.

Purchases

From: Adafruit: https://www.adafruit.com/product/3775
Raspberry Pi 3 — Model B+ 1.4GHz Cortex-A53 with 1GB RAM

From Staples: https://www.staples.com/dell-23-monitor-e2318hr/product_2767069
Dell E Model E2318HR 23" LED Monitor, Black

From: Adafruit: https://www.adafruit.com/product/4112
Official Raspberry Pi Keyboard — Black and Gray

From Adafruit: https://www.adafruit.com/product/4113
Official Raspberry Pi USB Optical Mouse — Black and Gray

From Adafruit: https://www.adafruit.com/product/1995
5V 2.5A…


When using the latest version of Raspbian Stretch, a variable named VIRTUALENVWRAPPER_PYTHON must be set to the path of the python version that you want to use when creating virtual environments. You can create python virtual environments that use python2.7, python3.5, python3.6 or python3.7. We will use python3.5.

Set the variable VIRTUALENVWRAPPER_PYTHON
First you need to find the path of the version of python that you want to use. You can find this path by opening a Terminal window and typing:

which python 3.5

The terminal responds with: /usr/bin/python3.5
In the hidden file .profile, set the value for VIRTUALENVWRAPPER_PYTHON. …


The Run Button

The toolbar in Codeblocks now looks like this:

Toolbar at Upper-Right

Following the Speed: slider is the “Run” button. Clicking on the Run button


It takes just a few minutes to design a nameplate using the Codeblocks application in Tinkercad. The export button in Codeblocks quickly creates a .stl for the nameplate to be 3D printed.

Here are the codeblocks for a nameplate:

The white box with a height of 2 mm serves as a base for the nameplate.

The move codeblock is used to center the text on the base and create raised text by increasing the Z value for the text.

The Scale codeblock (not used) can be used to make the text smaller and larger. …


If you are not familiar with Tinkercad’s Codeblocks see An Introduction to Tinkercad Codeblocks. Objects in Codeblocks may be considered to be parts. To illustrate this, consider designing a wrench. In an excellent tutorial, using standard Tinkercad, Dibya Chakravorty divided a wrench into three parts (a Ring, a Handle, and a Jaw).

Below, Codeblocks are used to design and simulate the parts of a wrench. Assembling the parts into a wrench is also done using Codeblocks. This has several advantages as compared to using standard Tinkercad.

  1. Codeblocks includes a simulator. You can press the Run button for an object (a…

One of the benefits of using tinkercad codeblocks is that you can easily create patterns that can be used to decorate your 3D prints. A good example of this is the Tea Light Holder:

Tea Light Holder (Lighted with a LED)

The basic pattern for this is simple and shown below as four holes.


If you are not familiar with Tinkercad’s Codeblocks see An Introduction to Tinkercad Codeblocks. Objects in Codeblocks may be considered to be parts. To illustrate this, consider designing a wrench. In an excellent tutorial, using standard Tinkercad, Dibya Chakravorty divided a wrench into three parts (a Ring, a Handle, and a Jaw).

Below, Codeblocks are used to design and simulate the parts of a wrench. Assembling the parts into a wrench is also done using Codeblocks. This has several advantages as compared to using standard Tinkercad.

  1. Codeblocks includes a simulator. You can press the Run button for an object (a…

The addition and subtraction operations on 3D Shapes are built into Tinkercad. Both the addition and subtration operations are executed by the
Create Group codeblock. The result is a new object. Click on the Export button to export the object as a .stl file (for 3D printing). If you are unfamiliar with using Tinkercad’s Codeblocks please see: An Introduction to Tinkercad Codeblocks. We begin by executing the addition operation for 2 overlapping cylinders.

The Addition Operation
Consider the codeblocks below:

Ron Mourant

TinyML, AI, Edge Impulse, Arduino, Raspberry Pi, Pickleball

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store