Example Code

NIWeek 2019 Deep Learning People Detector Using TensorFlow Model

Code and Documents

Attachment

Overview

 

This example demonstrates the use of the Deep Learning API to perform People Detection using TensorFlow Object Detection Model.

 

Description

 

This example uses a pre-trained TensorFlow Object Detection model SSD_Mobilenet_v1_Coco  model downloaded from TensorFlow’s Github. It detects people and objects from a live feed and overlays the class of the object detected. It also indicates the current number of people present in the feed and keeps track of how many people has been captured over time. The graph information is saved to a .csv file to a location of choice. This example demonstrates how to load a pre-trained model from the Model Zoo using the Model Importer API, supply LabVIEW image data as input and run the model.

 

Hardware and Software Requirements

 

LabVIEW 2018 64-bit and later

Vision Development Module 2019

Windows 10 64-bit or Linux RT 64-bit target

 

Steps to Implement or Execute Code

 

  • Extract the contents of both zip file. Place the ssd_mobilenet_v1_coco.pb file at the same level as the NIWeek_ssdmobileNet.vi.
  • Open the Block Diagram “NIWeek_ssdmobileNet.vi” and configure the Vision Acquisition Express VI to use your camera.
  • On the front panel of NIWeek_ssdmobileNet.vi, fill in the following controls:
    • Path to People in Frame .csv File: Enter the path to which you want to save the .csv file that will contain the number of people detected in the frame over the course of the day. The format should be like the following: C:\Users\nitest\Desktop.
    • Graph Start Date: Change it to today's date.
  • Run the VI.
  • Observe the overlays around the objects being detected. The graph shows the number of people that has been detected at the same time in the feed over the course of the day.

 

T. Le
Vision Product Support Engineer
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
PietH
Member
Member
on

Very impressive!

Thanks a lot for this example thuyanhl

Now I have an idea how to use other pretrained models with LabVIEW!

Matthew.L
Member
Member
on

@thuyanhl

You implied in your statement under “Hardware and Software Requirements” that this could be run on a Linux RT 64-bit target? But according to the 2019 Real-Time Module ReadMe (http://www.ni.com/pdf/manuals/374714k.html) LV only supports 32-bit.

Can this example be deployed to a NI Linux RT Target, if so how?

PietH
Member
Member
on

@thuyanhl

One question: How did you identify the names for the outputs (num_detections, detection_boxes and so forth)? (see image).
Thank you for your help
Peter

outputnames.jpg

Contributors