From 9c681eb127254dfd6a9b60aea35dd2e07cbdcac8 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Tue, 8 Sep 2020 12:43:11 +0530 Subject: Publish deploy 2020-09-08 12:43 --- posts/2019-12-10-TensorFlow-Model-Prediction/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'posts/2019-12-10-TensorFlow-Model-Prediction/index.html') diff --git a/posts/2019-12-10-TensorFlow-Model-Prediction/index.html b/posts/2019-12-10-TensorFlow-Model-Prediction/index.html index e287303..b3b3d60 100644 --- a/posts/2019-12-10-TensorFlow-Model-Prediction/index.html +++ b/posts/2019-12-10-TensorFlow-Model-Prediction/index.html @@ -1,4 +1,4 @@ -Making Predictions using Image Classifier (TensorFlow) | Navan Chauhan
1 minute readCreated on December 10, 2019Last modified on June 1, 2020

Making Predictions using Image Classifier (TensorFlow)

This was tested on TF 2.x and works as of 2019-12-10

If you want to understand how to make your own custom image classifier, please refer to my previous post.

If you followed my last post, then you created a model which took an image of dimensions 50x50 as an input.

First we import the following if we have not imported these before

import cv2 +Making Predictions using Image Classifier (TensorFlow) | Navan Chauhan
1 minute readCreated on December 10, 2019Last modified on June 1, 2020

Making Predictions using Image Classifier (TensorFlow)

This was tested on TF 2.x and works as of 2019-12-10

If you want to understand how to make your own custom image classifier, please refer to my previous post.

If you followed my last post, then you created a model which took an image of dimensions 50x50 as an input.

First we import the following if we have not imported these before

import cv2 import os

Then we read the file using OpenCV.

image=cv2.imread(imagePath)

The cv2. imread() function returns a NumPy array representing the image. Therefore, we need to convert it before we can use it.

image_from_array = Image.fromarray(image, 'RGB') -- cgit v1.2.3