Learning Objectives

****In this Lab, you will:

  1. Implement deep learning based computer vision applications on the Atlas 200DK.
  2. Learn to identify the category of an input image using an image classification model.
  3. Estimate the viewing direction of a person appearing in a given image, using a head pose estimation model.
  4. Learn how to use Python APIs and write code for model loading, inferencing and post-processing.

Requirement

Login to a remotely served Atlas 200 DK using your assigned IP.


1. Procedure: Image Classification

In this workshop, you will implement an image classification app on the Atlas200 DK, which can classify objects in images using the GoogLeNet network and output the top five classes with the highest confidence scores. Detailed steps, and explanations are provided in this guide, so you can understand how to build the app step by step. Figure 1 below shows the building blocks of the application pipeline.

Screenshot.PNG

The code for this project is available as a GitHub repository. You will first log in to the board, then download the repository to the board and finally run the experiments for the image and video branches of the project step-by-step.

1.2 Hands-on

  1. Download the GitHub repository to the board

    ****Login to the board using HwHiAiUser, run following command.

    mkdir /home/HwHiAiUser/HIAI_PROJECTS
    cd /home/HwHiAiUser/HIAI_PROJECTS
    git clone <https://github.com/Atlas200dk/sample_image_classification_c73_python.git>
    cd sample_image_classification_c73_python 
    
  2. Prepare GoogleNet model - Download the 'googlenet.prototxt' and 'googlenet.caffemodel' to the board.

    Create Model Directory:

    mkdir model && cd model
    

    Download the pre-trained googlenet Caffe model

    wget <https://github.com/Ascend-Huawei/models/raw/master/computer_vision/classification/googlenet/googlenet.prototxt> --no-check-certificate
    wget <https://obs-model-ascend.obs.cn-east-2.myhuaweicloud.com/googlenet/googlenet.caffemodel> --no-check-certificate
    
  3. Model Conversion - Run the following command in the same directory as the downloaded model files to convert the model from Caffe to Offline Model format

    atc --framework=0 --model="googlenet.prototxt" --weight="googlenet.caffemodel" --input_shape="data:1,3,224,224"  --input_fp16_nodes="data"  --input_format=NCHW --output="googlenet"  --output_type=FP32 --soc_version=Ascend310