The day/night image dataset consists of 200 RGB color images in two categories: day and night. There are equal numbers of each example: 100 day images and 100 night images.
We’d like to build a classifier that can accurately label these images as day or night, and that relies on finding distinguishing features between the two types of images!
Note: All images come from the AMOS dataset (Archive of Many Outdoor Scenes). 0.1.1 Import resources
Before you get started on the project code, import the libraries and resources that you’ll need.
|import cv2 # computer vision library import helpersimport numpy as npimport matplotlib.pyplot as plt%matplotlib inline|
0.2 Training and Testing Data
The 200 day/night images are separated into training and testing datasets.
- 60% of these images are training images, for you to use as you create a classifier.
- 40% are test images, which will be used to test the accuracy of your classifier.
First, we set some variables to keep track of some where our images are stored:
image_dir_training: the directory where our training image data is stored image_dir_test: the directory where our test image data is stored
: # Image data directories
image_dir_training = “day_night_images/training/” image_dir_test = “day_night_images/test/”
0.3 Load the datasets
These first few lines of code will load the training day/night images and store all of them in a variable, IMAGE_LIST. This list contains the images and their associated label (“day” or “night”).