DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. The Many Features of Apache MXNet GluonCV

The Many Features of Apache MXNet GluonCV

Let's take a quick look at how to use GluonCV for open source computer vision with Deep Learning.

Tim Spann user avatar by
Tim Spann
CORE ·
Nov. 07, 18 · Tutorial
Like (4)
Save
Tweet
Share
7.45K Views

Join the DZone community and get the full member experience.

Join For Free

In preparation for my talk at the Philadelphia Open Source Conference, Apache Deep Learning 201, I wanted to have some good images for running various Apache MXNet Deep Learning Algorithms for Computer Vision. 

Using Apache open source tools - Apache NiFi 1.8 and Apache MXNet 1.3 with GluonCV I can easily ingest live traffic camera images and run Object Detection, Semantic Segmentation and Instance Segmentation.

Code: (Github)

It's so easy, I am running multiple on the data to see which gives me the results I like. I am like YOLO, which is one of my old favorites.

  • yolonifitraffic.py
  • demo_mask_rcnn_nyc.py
  • demo_deeplab_nyc.py

So, we can find the cars and people in these webcams. Use cases can be around traffic optimization, public safety, and advertisement optimization. Due to licensing, I thought it better not to show Traffic Camera data here.

To industrialize and scale out this process from a single Data Scientist to a national ingestion system, we use the power of Apache NiFi to ingest, process and control flows. I am using the latest Apache NiFi 1.8.

Apache NiFi Flow to Ingest and Process Traffic Camera Data

First, we have a list of URLs that I want to process, and this can be sourced and stored anywhere. For ease of use with a static set, I am using GenerateFlowFile. I have a JSON file of URLs that I split and parse to call various Computer Vision Python scripts (DeepLab3, MaskRCNN, YOLO and others). YOLO seems to be the most useful so far. I am grabbing the results, some system metrics, metadata, and the Deep Learning analytics generated by Apache MXNet.

I split the flow into two portions. One builds GluonCV result data from YOLO and the other creates a file from TensorFlow results done on the fly.

Here is a list of my webcam URLs. There are millions of them out there.

If your data is tabular, then you need a schema for fast record processing.

An Example Dataset Returned from GLUONCV — YOLO Python 3.6 Script

I turn JSON data into HDFS Writeable AVRO Data and can run live SQL on it

One Output Source Code Be a Joint Slack Group

Object Detection: GluonCV YOLO v3 and Apache NiFi

This can be OpenCV, a static photo or from a URL.

Image title

Object Detection: Faster RCNN with GluonCV

Faster RCNN model trained on Pascal VOC dataset with ResNet-50 backbone

net = gcv.model_zoo.get_model(faster_rcnn_resnet50_v1b_voc, pretrained=True)

Image title

Instance Segmentation: Mask RCNN with GluonCV

Mask RCNN model trained on COCO dataset with ResNet-50 backbone

net = model_zoo.get_model('mask_rcnn_resnet50_v1b_coco', pretrained=True)

Photo by Ryoji Iwata on Unsplash

There are a lot of people crossing the street!

Semantic Segmentation: DeepLabV3 with GluonCV

GluonCV DeepLabV3 model on ADE20K dataset

model = gluoncv.model_zoo.get_model('deeplab_resnet101_ade', pretrained=True)

run1.sh demo_deeplab_webcam.py

This runs pretty slow on a machine with no GPU.

That is the best picture of me ever!

Semantic Segmentation: Fully Convolutional Networks

GluonCV FCN model on PASCAL VOC dataset

model = gluoncv.model_zoo.get_model(‘fcn_resnet101_voc ', pretrained=True)

run1.sh demo_fcn_webcam.py

It found me.

For NYC Dot and PennDot camera usage, you have to sign a developer agreement for a feed!

Apache MXNet Data science Apache NiFi Open source Deep learning

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • AIOps Being Powered by Robotic Data Automation
  • 2023 Software Testing Trends: A Look Ahead at the Industry's Future
  • Cloud-Based Transportation Management System
  • Distributed Stateful Edge Platforms

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: