<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sushanti Kerani on Medium]]></title>
        <description><![CDATA[Stories by Sushanti Kerani on Medium]]></description>
        <link>https://medium.com/@sushanti-kerani?source=rss-a8d9fd122b89------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RNOsPsC4NiEAZTxEqAeyxg.png</url>
            <title>Stories by Sushanti Kerani on Medium</title>
            <link>https://medium.com/@sushanti-kerani?source=rss-a8d9fd122b89------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 16:22:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sushanti-kerani/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Open tab paralysis]]></title>
            <link>https://sushanti-kerani.medium.com/open-tab-paralysis-2140988072fb?source=rss-a8d9fd122b89------2</link>
            <guid isPermaLink="false">https://medium.com/p/2140988072fb</guid>
            <category><![CDATA[overthinking]]></category>
            <category><![CDATA[laptop]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[work]]></category>
            <dc:creator><![CDATA[Sushanti Kerani]]></dc:creator>
            <pubDate>Thu, 16 May 2024 14:49:32 GMT</pubDate>
            <atom:updated>2024-05-16T16:00:01.766Z</atom:updated>
            <content:encoded><![CDATA[<p>For my fellow overthinkers:</p><blockquote>Ten thousand open tabs<br>3 different browsers<br>Stare back at me<br>As I try to make my way through them.</blockquote><blockquote>The screen reflects a mosaic of chaos<br>Tabs like scattered puzzle pieces <br>Each demanding attention<br>A jumble of cacophony.</blockquote><blockquote>If my laptop is a scattered desk<br>Then my mind is a cluttered room<br>Overflowing with thoughts <br>Like untamed vines.</blockquote><blockquote>Categorizing them is like herding cats<br>Music playing in one corner<br>Threads of Reddit weaving intricate patterns<br>Work clamoring for precedence<br>Unread emails whisper softly, yet persistently<br>Books beckon from forgotten corners<br>Lines of code waiting patiently for their turn <br>Side projects peek out from the shadows<br>Tutorials whisper promises of mastery<br>And<br>Health blogs advocate for a better self.</blockquote><blockquote>The list goes on<br>An endless scroll<br>As though my time here is limitless<br>In this digital sprawl where the world’s at my fingertips<br>I am but a tiny human being <br>Navigating through infinite possibilities.</blockquote><blockquote>So I pause, I breathe, Amidst the chaos<br>I make a list, a simple triad of priorities<br>In the quiet, I reclaim my agency.</blockquote><blockquote>And I tell myself</blockquote><blockquote>PS: You don’t need to buy that domain name.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2140988072fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cuttle: Convert your Emotion Recognition Notebook into an API without extra code using our open…]]></title>
            <link>https://medium.com/data-science/convert-your-emotion-recognition-notebook-into-an-api-without-extra-code-bc13421d2ed5?source=rss-a8d9fd122b89------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc13421d2ed5</guid>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[emotion-recognition]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Sushanti Kerani]]></dc:creator>
            <pubDate>Sat, 26 Jun 2021 09:55:54 GMT</pubDate>
            <atom:updated>2024-05-16T16:01:17.719Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cuttle: Convert your Emotion Recognition Notebook into an API without extra code using our open source tool</h3><h4>Training an Emotion Recognition in a Jupyter Notebook and converting it into a Flask API project without additional code using Cuttle</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8ZVQa3_Tzpy4cegO" /><figcaption>Source: <a href="http://unsplash.com/">Unsplash</a></figcaption></figure><p>For people who use Jupyter notebooks for development and testing quite often, you’re probably habituated to copying and pasting code around all the time.</p><blockquote>Deleting test snippets, using a different IDE to compile and test your code again, and developing an API is just a few of the time-consuming tasks an ML developer is used to.</blockquote><p>Wouldn’t it be great if we could automate the drudgery of boilerplate code needed to build an API project?<strong> </strong>Here we will train an emotion recognition model in a Jupyter Notebook and convert it into a Flask API project with absolutely no extra code!</p><h3>Dependencies</h3><pre>pip install <br>tensorflow==2.5.0 Keras==2.4.3 numpy==1.19.5 opencv-python==4.4.0.44</pre><p>We also need to install <a href="http://www.cuttle.it/">Cuttle</a> to convert our ML notebook into a Flask API project.</p><pre>pip install cuttle</pre><h3>Dataset</h3><p>You can use any dataset on emotion recognition or create your own dataset. In this article, we’re using the emotion recognition dataset available on Kaggle. You should find it <a href="https://www.kaggle.com/jonathanoheix/face-expression-recognition-dataset">here</a>. This dataset contains images of 7 classes: angry, disgust, fear, happy, neutral, sad, and surprise. If you want to add another class, just create a new directory and add images belonging to that class.</p><p>Create the notebook in the same directory as the dataset you downloaded having ‘train’ and ‘validation’ folders.</p><h3>Imports</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3b34215af1aba2d3f2a26ad13e2252da/href">https://medium.com/media/3b34215af1aba2d3f2a26ad13e2252da/href</a></iframe><h3>Dataset Augmentation</h3><p>The ImageDataGenerator allows you to fit models using image augmentation, transformation on each training image and also pass any pre-processing functions if available.</p><p>We’re rescaling images because colors range from [0–255] and rescaling them transforms each pixel value in the range of [0–1]. Here, we define the target size for our model as 48x48 and the batch_size as 64.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1842ae5c57d30ba1307fdbd65dd872c4/href">https://medium.com/media/1842ae5c57d30ba1307fdbd65dd872c4/href</a></iframe><h3>Model Training</h3><p>We’re defining a CNN here but you can choose to use any of the pre-trained models available like VGG16 or ResNet, or make use of transfer learning as well.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3dacf238b3bc9d19dd660bb641590c20/href">https://medium.com/media/3dacf238b3bc9d19dd660bb641590c20/href</a></iframe><p>Your model gets saved in the given path after completing the training.</p><h3>Emotion Recognition</h3><p>We now load the model, give it an image and test it. In this step, let’s introduce cuttle and turn the resultant function into an API that any frontend application can hit.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8daeff059685bddb8f420dcd4a3640b8/href">https://medium.com/media/8daeff059685bddb8f420dcd4a3640b8/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c46f4a385856122051f6358f61dfa72a/href">https://medium.com/media/c46f4a385856122051f6358f61dfa72a/href</a></iframe><p>Let’s use a test image ‘test.jpeg’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*9xIPrBdL1JwWIUlO" /><figcaption>Source: <a href="http://unsplash.com/">Unsplash</a></figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/34199de25d0f80a8930273b1391ffc8f/href">https://medium.com/media/34199de25d0f80a8930273b1391ffc8f/href</a></iframe><p>The output we get for this from the model prediction is <strong>‘fear’</strong>. Continue testing with a few more images till you’re satisfied with the model’s accuracy and results. Let’s look at how we can convert this into an API project.</p><h3>Initialize Cuttle</h3><p>Initialize cuttle with ‘cuttle init’ as follows and enter the name of the notebook being used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bWgPEeZay_g7lQGAykf_JA.png" /><figcaption>Source — Author</figcaption></figure><h3>Create Cuttle environment</h3><p>In this step, you name the environment, specify the platform you’re using, and which transformer you want to use. We want to use the <strong>flask</strong> transformer in this scenario. You can choose an environment name of your convenience. I’ve used ‘<strong>emotion-rec</strong>’ as an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-RL2yKuOMdBuvUvNvqL-DA.png" /><figcaption>Source — Author</figcaption></figure><p>At this point, your <strong>cuttle.json</strong> should look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*8YAeO54RDofDXt9V7-rJwg.png" /><figcaption>Source — Author</figcaption></figure><p>After you’re done creating the config, it’s time to edit your Jupyter notebook to include cuttle config. We only need to edit the last portion of the code to define the API route and set the output config.</p><p><strong>Adding Config to cells:</strong></p><p>We use Cuttle config to perform 2 main actions here as seen <a href="https://github.com/CuttleLabs/Emotion-Recognition-API/blob/main/Emotion_recogniser.ipynb">here</a>.</p><ul><li>disabling the training steps and load from the saved model file so as to not re-train every time we want to run the script.</li><li>specify the cell to be executed every time the API is called along with required parameters</li></ul><p>To disable cells, add this config at the beginning of the cell.</p><pre>#cuttle-environment-disable emotion-rec</pre><p>Now add config to transform your script into an API as follows:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c4ce40ad0d52e93b3b6428645d6963f4/href">https://medium.com/media/c4ce40ad0d52e93b3b6428645d6963f4/href</a></iframe><p>We’re setting two configs: the <strong>cuttle-environment-set-config</strong> and the <strong>cuttle-environment-assign</strong> configs. They are cell-scoped and line-scoped respectively. The cell-scoped config sets configuration needed during transformation for <strong>cells</strong>. The line-scoped config allows us to configure <strong>variables</strong>.</p><p>In the first line, we set the cell-scoped config specifying the environment name, the method, and the route of our choice. We also configure variable ‘file’ allowing us to get-config from the request method and the ‘output’ variable which is going to be our response.</p><h3>Transform</h3><p>Our last step is to cuttle-transform using the environment name we’ve been using. Let’s jump into how:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lgC-xQFOnINSFhrZ0GV6Hw.png" /><figcaption>Source — Author</figcaption></figure><p>After this step, you should see an <strong>output directory</strong> formed with another sub-directory containing the environment name. Go to this directory to spot your code that’s transformed into an API. Run this file as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*OtSGyfjeAyHI09iruqHqKg.png" /><figcaption>Source — Author</figcaption></figure><p>Now our code is running on localhost port 5000 by default. Test this out by sending images using Postman to get your response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P8SDk23DMo2NYSTNZehkeA.png" /><figcaption>test.jpeg sent via POST request to our flask API. Source — Author</figcaption></figure><p>Your API project is now ready to deploy! Cuttle also allows you to convert your notebook into a script or a pipeline.</p><h3>Resources</h3><p>Cuttle Website: <a href="https://www.cuttle.it/?utm_source=medium_article">cuttle.it</a><br>Github: <a href="https://github.com/CuttleLabs/Emotion-Recognition-API">Emotion recognition API source</a><br>Cuttle Source: <a href="https://github.com/CuttleLabs/cuttle-cli">Cuttle CLI Source</a></p><p>You can also find us on Twitter @ <a href="https://twitter.com/cuttlehq">https://twitter.com/cuttlehq</a></p><h3>About Author</h3><p>I’m Sushanti, a software developer with experience in Computer Vision, NLP, and Software Development. I graduated from Vellore Institute of Technology in 2020 and started anopen-source tool called Cuttle for fellow python developers. You can check it out <a href="https://www.cuttle.it/#">here</a>. My passions include reading, travel, and exploring the ever-evolving tech landscape.</p><p>Let’s connect and explore new possibilities together!<br>You can reach out to me via <a href="https://www.linkedin.com/in/sushanti-kerani/">LinkedIn</a>, <a href="http://sushantii.kerani@gmail.com/">Email</a> or <a href="https://twitter.com/Sushanti_Kerani">Twitter</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc13421d2ed5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/convert-your-emotion-recognition-notebook-into-an-api-without-extra-code-bc13421d2ed5">Cuttle: Convert your Emotion Recognition Notebook into an API without extra code using our open…</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>