summaryrefslogtreecommitdiff
path: root/posts/2019-12-10-TensorFlow-Model-Prediction/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'posts/2019-12-10-TensorFlow-Model-Prediction/index.html')
-rw-r--r--posts/2019-12-10-TensorFlow-Model-Prediction/index.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/posts/2019-12-10-TensorFlow-Model-Prediction/index.html b/posts/2019-12-10-TensorFlow-Model-Prediction/index.html
index 7b4d177..3b71ea8 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 @@
-<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"/><meta name="og:site_name" content="Navan Chauhan"/><link rel="canonical" href="https://navanchauhan.github.io/posts/2019-12-10-TensorFlow-Model-Prediction"/><meta name="twitter:url" content="https://navanchauhan.github.io/posts/2019-12-10-TensorFlow-Model-Prediction"/><meta name="og:url" content="https://navanchauhan.github.io/posts/2019-12-10-TensorFlow-Model-Prediction"/><title>Making Predictions using Image Classifier (TensorFlow) | Navan Chauhan</title><meta name="twitter:title" content="Making Predictions using Image Classifier (TensorFlow) | Navan Chauhan"/><meta name="og:title" content="Making Predictions using Image Classifier (TensorFlow) | Navan Chauhan"/><meta name="description" content="Making predictions for image classification models built using TensorFlow"/><meta name="twitter:description" content="Making predictions for image classification models built using TensorFlow"/><meta name="og:description" content="Making predictions for image classification models built using TensorFlow"/><meta name="twitter:card" content="summary"/><link rel="stylesheet" href="/styles.css" type="text/css"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="shortcut icon" href="/images/favicon.png" type="image/png"/><link rel="alternate" href="/feed.rss" type="application/rss+xml" title="Subscribe to Navan Chauhan"/><meta name="twitter:image" content="https://navanchauhan.github.io/images/logo.png"/><meta name="og:image" content="https://navanchauhan.github.io/images/logo.png"/></head><head><script src="https://www.googletagmanager.com/gtag/js?id=UA-108635191-1v"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-108635191-1');</script></head><body class="item-page"><header><div class="wrapper"><a class="site-name" href="/">Navan Chauhan</a><nav><ul><li><a href="/about">About Me</a></li><li><a class="selected" href="/posts">Posts</a></li><li><a href="/publications">Publications</a></li><li><a href="https://navanchauhan.github.io/assets/résumé.pdf">Résumé</a></li><li><a href="https://navanchauhan.github.io/repo">Repo</a></li></ul></nav></div></header><div class="wrapper"><article><div class="content"><span class="reading-time">🕑 1 minute read.</span><h1>Making Predictions using Image Classifier (TensorFlow)</h1><p><em>This was tested on TF 2.x and works as of 2019-12-10</em></p><p>If you want to understand how to make your own custom image classifier, please refer to my previous post.</p><p>If you followed my last post, then you created a model which took an image of dimensions 50x50 as an input.</p><p>First we import the following if we have not imported these before</p><pre><code><div class="highlight"><span></span><span class="kn">import</span> <span class="nn">cv2</span>
+<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"/><meta name="og:site_name" content="Navan Chauhan"/><link rel="canonical" href="https://navanchauhan.github.io/posts/2019-12-10-TensorFlow-Model-Prediction"/><meta name="twitter:url" content="https://navanchauhan.github.io/posts/2019-12-10-TensorFlow-Model-Prediction"/><meta name="og:url" content="https://navanchauhan.github.io/posts/2019-12-10-TensorFlow-Model-Prediction"/><title>Making Predictions using Image Classifier (TensorFlow) | Navan Chauhan</title><meta name="twitter:title" content="Making Predictions using Image Classifier (TensorFlow) | Navan Chauhan"/><meta name="og:title" content="Making Predictions using Image Classifier (TensorFlow) | Navan Chauhan"/><meta name="description" content="Making predictions for image classification models built using TensorFlow"/><meta name="twitter:description" content="Making predictions for image classification models built using TensorFlow"/><meta name="og:description" content="Making predictions for image classification models built using TensorFlow"/><meta name="twitter:card" content="summary"/><link rel="stylesheet" href="/styles.css" type="text/css"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="shortcut icon" href="/images/favicon.png" type="image/png"/><link rel="alternate" href="/feed.rss" type="application/rss+xml" title="Subscribe to Navan Chauhan"/><meta name="twitter:image" content="https://navanchauhan.github.io/images/logo.png"/><meta name="og:image" content="https://navanchauhan.github.io/images/logo.png"/></head><head><script src="https://www.googletagmanager.com/gtag/js?id=UA-108635191-1v"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-108635191-1');</script></head><body class="item-page"><header><div class="wrapper"><a class="site-name" href="/">Navan Chauhan</a><nav><ul><li><a href="/about">About Me</a></li><li><a class="selected" href="/posts">Posts</a></li><li><a href="/publications">Publications</a></li><li><a href="/assets/résumé.pdf">Résumé</a></li><li><a href="https://navanchauhan.github.io/repo">Repo</a></li></ul></nav></div></header><div class="wrapper"><article><div class="content"><span class="reading-time">🕑 1 minute read.</span><h1>Making Predictions using Image Classifier (TensorFlow)</h1><p><em>This was tested on TF 2.x and works as of 2019-12-10</em></p><p>If you want to understand how to make your own custom image classifier, please refer to my previous post.</p><p>If you followed my last post, then you created a model which took an image of dimensions 50x50 as an input.</p><p>First we import the following if we have not imported these before</p><pre><code><div class="highlight"><span></span><span class="kn">import</span> <span class="nn">cv2</span>
<span class="kn">import</span> <span class="nn">os</span>
</div>
@@ -20,4 +20,4 @@
</code></pre><p>Finally we make the prediction</p><pre><code><div class="highlight"><span></span><span class="k">print</span><span class="p">([</span><span class="s1">&#39;Infected&#39;</span><span class="p">,</span><span class="s1">&#39;Uninfected&#39;</span><span class="p">][</span><span class="n">np</span><span class="o">.</span><span class="n">argmax</span><span class="p">(</span><span class="n">model</span><span class="o">.</span><span class="n">predict</span><span class="p">(</span><span class="n">img</span><span class="p">))])</span>
</div>
-</code></pre><p><code>Infected</code></p></div><span>Tagged with: </span><ul class="tag-list"><li><a href="/tags/tutorial">tutorial</a></li><li><a href="/tags/tensorflow">tensorflow</a></li><li><a href="/tags/codesnippet">code-snippet</a></li></ul><div id="disqus_thread"></div><script>(function() {var d = document, s = d.createElement('script');s.src = 'https://navan-chauhan.disqus.com/embed.js';s.setAttribute('data-timestamp', +new Date());(d.head || d.body).appendChild(s); })();</script><noscript>Please enable JavaScript to view the comments</noscript></article></div><footer><p>Made with ❤️ using <a href="https://github.com/johnsundell/publish">Publish</a></p><p><a href="/feed.rss">RSS feed</a></p></footer></body></html> \ No newline at end of file
+</code></pre><p><code>Infected</code></p></div><span>Tagged with: </span><ul class="tag-list"><li><a href="/tags/tutorial">tutorial</a></li><li><a href="/tags/tensorflow">tensorflow</a></li><li><a href="/tags/codesnippet">code-snippet</a></li></ul><div id="disqus_thread"></div><script src="/assets/disqus.js"></script><noscript>Please enable JavaScript to view the comments</noscript></article></div><footer><p>Made with ❤️ using <a href="https://github.com/johnsundell/publish">Publish</a></p><p><a href="/feed.rss">RSS feed</a></p></footer></body></html> \ No newline at end of file