/ASL-Pytorch

This repo has been modified for a workshop. Link to original repo: https://github.com/IBM/ASL-Pytorch

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

Build an American Sign Language alphabet classifier using pytorch and GPU environments on Watson Studio

Overview

we will use PyTorch to build and train a deep learning model to classify images to 29 classes (26 ASL alphabet, space, Del, and nothing) which can be used later to help Deaf peope communicate with other and maybe with computers as well. We will use a pre-trained mobile network and we will define our classifier and connect it to network, then train this classifier along with some of the last blocks of the network on our dataset.

In this notebook we will:

1- Obtain dataset from Kaggle.
2- explore data and define transformers to preprocess images before training.
3- define our classifier to have an output layer of 29 outputs.
4- train the last blocks of the network along with the classifier we defined.
5- test the model we trained.

This notebook uses python 3.6 + GPU environment which allow us to do the whole process and train complex model in the same place which is a notebook in Watson studio. Learn more about available environments Watson Studio environments.

Flow

Flow

  1. Log into IBM Watson Studio.
  2. Get your Kaggle API credentials
  3. Run the Jupyter Notebook in Watson Studio.

Instructions

  1. Sign up for Watson Studio
  2. Create a new project
  3. Create the notebook
  4. Run the notebook
  5. Test your model

1. Sign up for Watson Studio

We will use Watson studio to run this notebook, Watson studio is available through IBM cloud or IBM Cloud Paks For Data.

  • To start you must have IBM cloud account, Get your for free Here.
  • From the catalog create a watson studio with standard plan or more and make sure the region is dallas to enable GPU environment.
  • Alternatively, you can use the ASL_PyTorch-CPU Notebook if you are a Watson Studio Lite Plan user

CREATE WS

2. Create a new project

From the Watson Studio home page, select Creat a project, then select the Create an empty project and choose a name for your project then press create .

CREATE Project

3. Create the notebook

NOTEBOOK

4. Run the notebook

To view your notebooks, select Notebooks in the project Assets list. To run a notebook, simply click on the edit icon listed in the row associated with the notebook in the Notebooks list.

ASL notebook

Follow notebook instructions to load data and train the model.

Cells are how notebooks are structured and are the areas where you write your code. To run a piece of code, click on the cell to select it, then press SHIFT+ENTER or press the play button in the toolbar above. Additionally, the Cell dropdown menu has several options to run cells, including running one cell at a time or to run all cells at once.

4. Test the model

The last two cells in the notebook is where we test our trained model. run the last model many times to check different samples.

Result

check notebook result

Notebook with outputs

links

Learn more