In this tutorial, you will build a classifier model to recognize weather in photos and video frames. Such a model can provide individuals, organizations, and communities with accurate weather forecasts, allowing them to plan, prepare, and make informed decisions based on weather patterns. It can have wide-ranging applications across multiple sectors and contribute to improved safety, efficiency, and resource optimization in many industries.

 

To create the model, use the publicly available Weather Image Recognition and Weather Classification datasets.

 

#Adding the datasets

 

Go to the Owned datasets and click Add new dataset. Enter a dataset name, select Personal the dataset type, and click Create.

 

Create dataset
Create dataset

 

Both datasets have been saved in a .zip archive. Select Add archive.

 

Upload view
Upload view

 

Once the archive is loaded, click Upload.

 

Upload archive
Upload archive

 

Before uploading, you will be informed of our image size limits. Decide what the application should do if the size limit is exceeded. For this tutorial select Scale.

 

Image limits
Image limits

 

The uploading task is performed in the background. You can monitor the progress of the Dashboard or Datasets view.

 

Dashboard view
Dashboard view

 

After uploading the first dataset, follow the same steps to upload the second one.

 

#Creating the model

 

Go to the Models section and click Add new model. Select Classification.

 

Add new model
Add new model

 

From the Weather Image Recognition dataset select snow, fog, smog, hail, rain, and lightning categories, and from the Weather Classification dataset select cloudy, rainy, shine, and foggy.

 

Choose datasets and categories
Choose datasets and categories

 

In the merge categories step, move the rainy category to the RAIN bucket and fogsmog to the FOGGY bucket. Delete RAINY and FOGSMOG buckets. Click Next to continue.

 

Merge categories
Merge categories

 

Enter the model name and select the Configure automatically option. Click Next.

 

Set model parameters
Set model parameters

 

Set the accuracy to 90%. Click Start training.

 

Configuration
Configuration

 

You can view the training progress in the Dashboard view, in the Notifications tab, or the Models section.

 

#Testing your idea

 

When the training is complete, go to the Models section and click on the Weather Classification model.

 

Models section
Models section

 

In the Conversion section, select the NVIDIA MAXWELL architecture.

 

Select hardware
Select Hardware

 

Once converted, click on the device to connect to it.

 

Select device
Select device

 

Copy the registration code to the clipboard, then click Copy token and go to device. This will open a new tab in your browser with a web app that is now using your local device.

 

Connect to the device
Connect to the device

 

Enter your e-mail, paste your registration code into the Token field, and create a password. Once registered, the device will change its status to Connected in the Live Testing section of the OSAI app.

 

AIDWS
AIDWS

 

Select NVIDIA Maxwell hardware.

 

Select hardware
Select hardware

 

Click on the Weather Classification model to download it to the device's local memory.

 

Model selection
Model selection

 

Click the Upload File button. You can upload either a photo or a video. For this tutorial, we will first use video files.

 

Upload file
Upload file

 

After uploading your video file, you can change its settings. This time, we have selected the Don't upload option. Click Next to continue.

 

Settings
Settings

 

Once the video has been processed by the web app, you can view the results.

 

#Results

 

Lightning
Lightning
Snow
Snow
Fog
Fog
Cloudy
Cloudy

 

Now, let's test the model on images:

 

Rain
Rain
Hail
Hail
Shine
Shine