Before we can train an ML model, we need to collect some images. For this model, we'll need two categories: images that have a package in them and images that don't.

To make our model more accurate under various weather conditions and other situations, it's useful to have lots of pictures in both categories at different times of day and in different lighting conditions.

Install your Pi with the Camera pointing towards a package drop-off spot.

I installed my Pi just inside the door frame, with the camera outside and pointing down.

Open a terminal window and connect to your Pi via SSH.

Tip: Your IP address is displayed on the screen of the BrainCraft

In terminal, run the lobe-capture.py program with the following commands:

cd ~
cd lobe-adafruit-kit
python3 lobe-capture.py

Collect training images

Using the button on the BrainCraft, take 20-30 pictures with no packages. These pictures will be our baseline.

Holding the button down will take a burst of pictures.

Next take 20-30 with packages.

Use as many different boxes as you have, and try moving the packages around, stacking them, and using a different number.

Upload all the pictures to your computer using FTP, and put them in a folder called Package Detector.

Inside of that folder create two more folders called no package and package. Sort your images into those two folders.

Make sure your folder names are the same (including punctuation) for the sample code to work!

This guide was first published on Mar 30, 2021. It was last updated on 2021-03-30 15:53:33 -0400.

This page (Collect Images) was last updated on Sep 29, 2021.

Text editor powered by tinymce.