January 28, 2021 By Vidyasagar Machupalli 2 min read

Learn about IBM Cloud™ Code Engine by deploying an image classification application with pre-defined MobileNet TensorFlow.js model.

In my previous post, “Text Analysis with IBM Cloud Code Engine” you learned how to create an IBM Cloud™ Code Engine project, select the project and deploy Code Engine entities — applications and jobs to the project. You also learned how to bind IBM Cloud services (e.g., IBM Cloud Object Storage and Natural Language Understanding) to your Code Engine entities to analyze your text files uploaded to Cloud Object Storage.

In this post, you will deploy an image classification application, upload images to IBM Cloud Object Storage and then classify the uploaded images using a pre-defined MobileNet Tensorflow.js model without any training. The images are classified with labels from the ImageNet database.

Clone the repository

On your machine, launch a terminal or command prompt and run the below commands to clone the GitHub repository and then move it to the cloned repo folder:

git clone https://github.com/VidyasagarMSC/image-classification-code-engine
cd image-classification-code-engine

Build the container images

Before building and pushing your container images, plan your image registry:

  1. If you plan to use a private container registry like IBM Cloud Container Container Registry, follow the steps here to add access to a private registry.
  2. If you plan to use public Docker Hub, run the below command to build and push three container images — frontend, backend and backend-job respectively. Replace <DOCKER_ACCOUNT_NAME> with your own Docker account name: ./deploy.sh <DOCKER_ACCOUNT_NAME>.
  3. If you don’t wish to build your own container images, you can use the pre-built container images — vidyasagarmsc/*. For example: docker pull vidyasagarmsc/frontend.

Use the container images with the solution tutorial

Follow the steps in the solution tutorial and use this code sample to learn about IBM Cloud Code Engine by deploying an image classification application.

Use the container images built from this code sample. Replace ibmcom/* with <ACCOUNT_NAME>/*.

Instead of uploading a text file, upload an image (.jpeg, .png) to COS. For sample images, check the images folder in this repo.

The result

You can find the sample images to test the classification under the output folder of the repository:

Questions and feedback

If you have feedback, suggestions or questions about this post, please reach out to me on Twitter (@VidyasagarMSC) or use the feedback button on the tutorial to report a problem on its content. You can also open issues

The tutorials section has a feedback form on the side where you can comment on the content. If you have suggestions on the existing tutorials or ideas for future additions, please submit your feedback.

Was this article helpful?
YesNo

More from Cloud

Attention new clients: exciting financial incentives for VMware Cloud Foundation on IBM Cloud

4 min read - New client specials: Get up to 50% off when you commit to a 1- or 3-year term contract on new VCF-as-a-Service offerings, plus an additional value of up to USD 200K in credits through 30 June 2025 when you migrate your VMware workloads to IBM Cloud®.1 Low starting prices: On-demand VCF-as-a-Service deployments begin under USD 200 per month.2 The IBM Cloud benefit: See the potential for a 201%3 return on investment (ROI) over 3 years with reduced downtime, cost and…

24 IBM offerings winning TrustRadius 2024 Top Rated Awards

2 min read - TrustRadius is a buyer intelligence platform for business technology. Comprehensive product information, in-depth customer insights and peer conversations enable buyers to make confident decisions. “Earning a Top Rated Award means the vendor has excellent customer satisfaction and proven credibility. It’s based entirely on reviews and customer sentiment,” said Becky Susko, TrustRadius, Marketing Program Manager of Awards. Top Rated Awards have to be earned: Gain 10+ new reviews in the past 12 months Earn a trScore of 7.5 or higher from…

IBM Tech Now: April 8, 2024

< 1 min read - ​Welcome IBM Tech Now, our video web series featuring the latest and greatest news and announcements in the world of technology. Make sure you subscribe to our YouTube channel to be notified every time a new IBM Tech Now video is published. IBM Tech Now: Episode 96 On this episode, we're covering the following topics: IBM Cloud Logs A collaboration with IBM watsonx.ai and Anaconda IBM offerings in the G2 Spring Reports Stay plugged in You can check out the…

IBM Newsletters

Get our newsletters and topic updates that deliver the latest thought leadership and insights on emerging trends.
Subscribe now More newsletters