<?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 poornima narasimhan on Medium]]></title>
        <description><![CDATA[Stories by poornima narasimhan on Medium]]></description>
        <link>https://medium.com/@talktopoorni?source=rss-e9030989fa35------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*65C8-d_EPHwGvBVa.</url>
            <title>Stories by poornima narasimhan on Medium</title>
            <link>https://medium.com/@talktopoorni?source=rss-e9030989fa35------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 13:40:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@talktopoorni/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[Noise Cancellation in Headphones — An insight]]></title>
            <link>https://talktopoorni.medium.com/noise-cancellation-in-headphones-an-insight-ace7aa541a44?source=rss-e9030989fa35------2</link>
            <guid isPermaLink="false">https://medium.com/p/ace7aa541a44</guid>
            <category><![CDATA[noise-cancelling]]></category>
            <category><![CDATA[headphones]]></category>
            <category><![CDATA[anc]]></category>
            <category><![CDATA[headset]]></category>
            <category><![CDATA[noise-cancellation]]></category>
            <dc:creator><![CDATA[poornima narasimhan]]></dc:creator>
            <pubDate>Thu, 05 May 2022 11:47:32 GMT</pubDate>
            <atom:updated>2022-05-05T11:47:32.759Z</atom:updated>
            <content:encoded><![CDATA[<h3>Noise Cancellation in Headphones — An insight</h3><p>With the advent of smartphones, tablets and other digital assistants taking mainstream in every day life, delivery of high quality audio for playback and phone calls becomes quintessential in addition to partial or even complete elimination of undesired outside noise also called environment noise or ambient noise. “Noise Cancellation” — a technique that helps in filtering unnecessary background noise from the more essential sounds. This itself encompasses diverse approaches and becomes a bit more complex when applied to headphones.</p><p>With OEMs looking for a stellar differentiator for their products, headsets that offer compelling noise-cancellation technology stand ready to easily capitalize. The purpose of this writeup is to shed some light on the basics of noise cancellation and provide insight in to the differences between them.</p><h3>Noise Cancellation types</h3><p><strong>Passive Noise Cancellation (PNC) / Noise Isolation</strong></p><p>Passive Noise Cancellation (PNC) or Noise Isolation is when the headphones, earphones, earbuds, or in-earphones by itself block outside noise through the use of physical barriers. Imagine we closing our ears with our palms, PNC a.k.a Noise Isolation in headphones achieves the same result by providing a secure seal using the foam pads in the ear cups.</p><p>In other words, it is the amount of noise cancellation offered by the physical device when put on head or in ears, ideally how well it works as an ordinary earplug. While a very good design can provide a strong passive cancellation before electronics are applied, PNC is often limited to cancelling frequencies above 1 kHz, more of middle and high frequencies. PNC headphones provide a very good experience when the ear cups completely snuggle the ears without leaving a gap.</p><p>Specifically, Circumaural headphones (Over-ear headphones) and On-ear headphones offer passive noise cancellation features, but the one offered by over-ear headphone makes all the difference where it blocks the ambient sound / outside noise giving you great-sounding music / call. In these headphones, Passive noise cancellation accounts for 99% of the noise reduction, which is really good.</p><p><strong>Active Noise Cancellation (ANC)</strong></p><p>Active noise cancellation (ANC) uses noise cancelling technology to neutralize the ambient noise around us. It works by using additional microphones into the headphones to monitor environmental noise which listen to the outside world (noise) and generate a phase-inverted sound that effectively cancels out ambient noise before it reaches our ears. in simple words, ANC cancels noise by creating equal but opposite noise.</p><p>“Active” basically means that headphones have a built-in battery that’s dedicated to powering these dedicated noise-canceling microphones. Improvements in ANC has been significant and battery efficient now that these can be used in true wireless in-ear earphones.</p><p>ANC can be achieved with either digital filters or analog filters, and is generally differentiated by the mechanism of cancellation namely feed-forward, feedback or hybrid. A combination of good active and passive cancellation will drastically improve headset performance.</p><p>Though there are variety of ANC like feedforward, feedback and hybrid, hybrid ANC, is a best choice for flying, travel etc., as they will filter both low frequency noises — like aircraft — and higher frequencies like human voices, enabling us create a space of our own whatsoever be the environment around us.</p><p><strong>Adaptive Active Noise Cancellation (Adaptive ANC)</strong></p><p>Adaptive ANC means the levels of noise cancellation is changed automatically on its own without user interference. This is done by detecting changes in the frequency of sound coming at the listener and adapting in real-time for maximum performance. This is more advanced ANC where the level of noise cancelling digitally adapts to the surroundings.</p><p>Basically the noise cancellation is high (stronger) when the background noise is loud and vice versa. The higher is the amount of noise cancellation the more aggressively it cleans the sound, negatively impacting its voice quality, so cautious design matters in terms of noise cancellation.</p><p><strong>Adjustable Active Noise Cancellation (Adjustable ANC)</strong></p><p>In adjustable ANC, the user is allowed to change how much background noise they hear by manually adjusting noise cancellation levels. This feature is particularly useful when user wants to have full control over the noise cancellation feature. A classic example could be using the headset during walking over a busy traffic either for music or on a call etc.</p><p><strong>Transparency Mode a.k.a Ambient Fusion</strong></p><p>Transparency mode also called ambient fusion, lets you hear what you want to hear around you and interact with the world around you. In this mode, we can clearly hear the announcement of the train arrivals in a station or subway, traffic alerts etc., without taking off the headphones.</p><p>“Noise Cancellation” is a blessing in today’s world where most of us work from home, attend schools and colleges online etc., Advances in this technology combined with Artificial Intelligence has been humungous and growing day by day.</p><p>Though there are several modes of noise cancellation, in particular active ANC, not only has an effect on sound quality but also on user ears. When ANC is switched on, soundwaves are created which in turn create a pressure against your ears. This is not a painful one, but very similar to a sensation when an airplane takes off. So when using headphones for an extended period of time, users must be aware of noise cancellation and use their best judgement for setting it accordingly.</p><p><strong>References</strong></p><p><a href="https://www.gearpatrol.com/tech/audio/a33447779/whats-the-difference-between-passive-and-active-noise-canceling-headphones/">What&#39;s the Difference Between Passive and Active Noise Canceling Headphones?</a></p><p><a href="https://www.electronicdesign.com/industrial-automation/article/21805808/cirrus-logic-whats-the-difference-between-passive-and-active-noise-cancellation">https://www.electronicdesign.com/industrial-automation/article/21805808/cirrus-logic-whats-the-difference-between-passive-and-active-noise-cancellation</a></p><p><a href="https://www.howtogeek.com/746513/what-is-transparency-mode-and-how-does-it-work-in-headphones/">What Is Transparency Mode, and How Does It Work in Headphones? (howtogeek.com)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ace7aa541a44" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exciting world of “Audio” Wearables — Headsets & Earbuds]]></title>
            <link>https://talktopoorni.medium.com/exciting-world-of-audio-wearables-headsets-earbuds-be0016d81c42?source=rss-e9030989fa35------2</link>
            <guid isPermaLink="false">https://medium.com/p/be0016d81c42</guid>
            <category><![CDATA[earbuds]]></category>
            <category><![CDATA[headset]]></category>
            <category><![CDATA[wearables]]></category>
            <category><![CDATA[hearables]]></category>
            <category><![CDATA[audio]]></category>
            <dc:creator><![CDATA[poornima narasimhan]]></dc:creator>
            <pubDate>Mon, 22 Feb 2021 09:22:07 GMT</pubDate>
            <atom:updated>2021-02-22T09:22:07.203Z</atom:updated>
            <content:encoded><![CDATA[<h3>Exciting world of “Audio” Wearables — Headsets &amp; Earbuds</h3><p>Headphones/Earphones/Earbuds once thought to be a music lovers companion, has gained significant attention from a wider range of audience including office environments, work from home scenarios etc.,. The intent of this writeup is to summarize some of the advancements in this field including the influence of Artificial Intelligence on the same.</p><h4>Personalized EQ / Hearing</h4><p>In addition to default equalizers provided in headphones, the end user is given the flexibility to tune the audio played back based on their listening ability and sensitivity to hearing different frequencies. This is generally facilitated via an application. An audio test / personalized hearing test to measure the users listening response at different frequencies is performed by playing tones / series of sounds. The audio settings are them calibrated to match the specific frequencies that the user is most sensitive to.</p><h4>Hybrid ANC — Active Noise Cancellation</h4><p>Noise Cancellation in headsets has been in existence for more than 2 decades now, helping in smoother airplane rides etc.,. Development of “hybrid” active noise cancellation (ANC) headphones, by placing microphones on both the interior and exterior of the ear cup is gaining momentum. Hybrid ANC can suppress noise over a wider frequency range, adapt to and correct errors and is less sensitive to sound angle and user wear. Hybrid ANC supports multiple modes and interestingly, “Ambient Noise / Transparency Mode” allows ambient external noise to pass through while you’re listening to the headphones. This can be very useful in an environment where the end user has to remain aware of the surroundings like walking in a road, bus or train ride etc.,</p><h4>Sense of Hearing / Smart Sound / Acoustics scene detection</h4><p>The ability of hearable devices to recognize sounds that cannot be heard by the users wearing it, as well as adapting to the acoustic environment to enhance the audio experience with no compromise to battery life defines the sense of hearing. The consumers can use the wearables without worrying or losing touch with the world around them, be it, traffic, train station or an airplane.</p><p>For example, user wearing over the ear headphone at home can be alerted of any safety alarms like smoke alarm, glass shattering, etc., Indeed during voice calls baby crying, dog bark etc., can be detected and handled. This is also called as acoustics scene detection.</p><p>The feature does not require any additional hardware as today most of the headphones, earphones and earbuds are already equipped with an external facing microphones for ANC which can be used for smart sound recognition.</p><h4>Bone Conduction Headphones</h4><p>Bone conduction headphones are gaining popularity especially with runners, people with hearing disabilities and has its roots in hearing aid technology and also been used in military applications. In such devices there are no earbuds at all, instead the audio is sent directly to the cochlea, completely bypassing the eardrums.</p><h4>References</h4><ol><li>AI on Wearables <a href="https://www.epdtonthenet.net/article/169424/Headphones-gain-AI-powered--sense-of-hearing--via-new-Audio-Analytic-patent.aspx">https://www.epdtonthenet.net/article/169424/Headphones-gain-AI-powered--sense-of-hearing--via-new-Audio-Analytic-patent.aspx</a></li><li>Future of headphone — <a href="https://mixdownmag.com.au/news/product/is-this-the-future-of-headphone-technology/">https://mixdownmag.com.au/news/product/is-this-the-future-of-headphone-technology/</a></li><li>Audio Technology Enhancement — Headphones <a href="https://resources.pcb.cadence.com/blog/4-exciting-advances-in-audio-headphone-and-listening-technology">4 Exciting Advances in Audio Headphone and Listening Technology (cadence.com)</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be0016d81c42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running ML and AI on constraint IoT embedded devices — A game changer]]></title>
            <link>https://talktopoorni.medium.com/running-ml-and-ai-on-constraint-iot-embedded-devices-a-game-changer-45fb5c15e003?source=rss-e9030989fa35------2</link>
            <guid isPermaLink="false">https://medium.com/p/45fb5c15e003</guid>
            <category><![CDATA[microcontrollers]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <dc:creator><![CDATA[poornima narasimhan]]></dc:creator>
            <pubDate>Thu, 11 Jun 2020 16:28:28 GMT</pubDate>
            <atom:updated>2020-06-11T16:28:28.210Z</atom:updated>
            <content:encoded><![CDATA[<h3>Running ML and AI on constraint IoT embedded devices — A game changer</h3><p>Being an embedded developer, i have always envisaged “Machine Learning” (ML) and “Artificial Intelligence” (AI) technologies requires humongous amount of computing power to perform their expected behavior. So to attempt any kind of AI or ML on any embedded device like raspberry pi or microcontrollers like arduino had always been daunting. Interestingly, “<em>Tiny ML / Tensorflow Lite</em>”, focuses on taking ML to constraint IoT devices operating at low power or ultra low power range.</p><p><strong>What is <em>TinyML / Tensorflow lite</em> ?</strong></p><p>According to the <a href="https://www.tinyml.org/summit/">TinyML Summit</a> it is defined as “Tiny machine learning is broadly defined as a fast growing field of machine learning technologies and applications including hardware (dedicated integrated circuits), algorithms and software capable of performing on-device sensor (vision, audio, IMU, biomedical, etc.) data analytics at extremely low power, typically in the mW range and below, and hence enabling a variety of always-on use-cases and targeting battery operated devices.”</p><p>According to <a href="https://www.tensorflow.org/lite/microcontrollers">tensorflow</a>, “TensorFlow Lite for Microcontrollers is an experimental port of TensorFlow Lite designed to run machine learning models on microcontrollers and other devices with only kilobytes of memory. It doesn’t require operating system support, any standard C or C++ libraries, or dynamic memory allocation”</p><p><strong>Why TinyML/Tensorflow Lite ?</strong></p><p>There are approximately 200+ billion microcontrollers in the world today. The market study shows, 28.1 billion units were sold in 2018 alone, and IC Insights forecasts annual shipment volume to grow to <a href="http://www.icinsights.com/news/bulletins/Microcontrollers-Will-Regain-Growth-After-2019-Slump/">38.2 billion by 2023</a>. Global AI in embedded IoT devices market will approach $26.2B USD by 2023 as quoted by <a href="https://www.prnewswire.com/news-releases/global-artificial-intelligence-of-things-aiot-solutions-market-report-2018-global-ai-in-embedded-iot-devices-market-will-approach-26-2b-usd-by-2023--300794268.html">prnewswire</a>. These will start enabling the future of embedded IoT devices on the so called “true edge” that can do really great things which we thought were not possible.</p><p>Though edge computing has been gaining momentum, it cannot solve all problems most importantly <em>data privacy</em>. Data privacy concerns are ruling the world today and especially in scenarios like smart home where consumers are truly excited about home automation and at the same time equally concerned for data leaving the premises. TinyML/Tensorflow Lite, if implemented, can confine the processing of data on the IoT device itself there by ensuring privacy</p><p>Another interesting problem that can be addressed is in areas of limited or no connectivity such as rural areas, sea etc., is <em>reliability, </em>where either cloud or edge can do no help in connectivity. TinyML/Tensorflow Lite can enable the ability to perform certain ML and AI operations locally, there by producing several advantages</p><p>In mission critical applications, where a millisecond delay could also cost, “<em>Latency</em>” is an important parameter. Though edge computing reduces the network latency to a significant extent, executing certain ML operations on the device itself could save further.</p><p>In addition to above, factors like energy consumption, network bandwidth etc., could also prove beneficial in terms of using ML and AI operations on the device itself.</p><p>The above are many potential advantages of using TinyML/Tensorflow Lite than edge computing</p><p><strong>Books &amp; Resources</strong></p><p><a href="https://www.tinyml.org/">https://www.tinyml.org/</a> has plethora of information on the concept and their summits etc.,</p><p>“TensorFlow Lite” — <a href="https://www.tensorflow.org/lite/microcontrollers">https://www.tensorflow.org/lite/microcontrollers</a></p><p>A blog on tinyML and technology aspects in detail was an interesting read <a href="https://www.ericsson.com/en/blog/2019/12/tinyml-as-a-service">https://www.ericsson.com/en/blog/2019/12/tinyml-as-a-service</a></p><p><a href="https://venturebeat.com/2020/01/11/why-tinyml-is-a-giant-opportunity/">https://venturebeat.com/2020/01/11/why-tinyml-is-a-giant-opportunity/</a> is another good read on why ML on IoT embedded devices could be game changers and a giant opportunity as well</p><p><a href="https://www.enterpriseai.news/2020/06/08/qeexo-takes-tinyml-to-aws-cloud/">https://www.enterpriseai.news/2020/06/08/qeexo-takes-tinyml-to-aws-cloud/</a> takes tinyML to AWS cloud is another interesting offering</p><p>A book from the creators seems to be interesting to understand TinyML</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*saz1-PdAYCmSdQaS" /></figure><p><strong>Conclusion</strong></p><p>With more maturity and adoption, running ML and AI algorithms on memory, power constraint IoT embedded devices seems to be a clear game changer in the field of IoT and bring plethora of opportunities in the same. It will be interesting to watch this field and try few algorithms on either a raspberry pi device or a microcontroller</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45fb5c15e003" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Imperative Commands in Kubernetes — A Primer]]></title>
            <link>https://talktopoorni.medium.com/imperative-commands-in-kubernetes-a-primer-9565c25535f7?source=rss-e9030989fa35------2</link>
            <guid isPermaLink="false">https://medium.com/p/9565c25535f7</guid>
            <category><![CDATA[imperative]]></category>
            <category><![CDATA[kubectl]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cluster-management]]></category>
            <category><![CDATA[k8s]]></category>
            <dc:creator><![CDATA[poornima narasimhan]]></dc:creator>
            <pubDate>Wed, 19 Feb 2020 12:29:58 GMT</pubDate>
            <atom:updated>2020-02-19T12:50:35.300Z</atom:updated>
            <content:encoded><![CDATA[<h3>Imperative Commands in Kubernetes — A Primer</h3><p>“<strong><em>kubectl</em></strong>”, the command line tool of K8s is used for interacting with Kubernetes clusters. The tool is used to deploy the container workloads into production clusters, inspect and manage cluster resources, view logs etc. According to K8s it is like a “Swiss Army Knife” of container orchestration and management.</p><p>There are fundamentally two types of K8s object management namely <strong><em>Imperative (with kubectl commands) </em></strong>and<strong><em> Declarative ( by writing manifests and using </em></strong>kubectl apply) modes. Each has its own advantages and disadvantages, and its highly recommended to manage a K8s object by a single method. Imperative commands are in general good for learning and interactive experiments on K8s, though they donot expose the full flexibility of the API. Declarative commands are useful for reproducible deployments and production.</p><p>In this article, I attempt to describe on how to use kubectl to interact with clusters and in particular summaries the imperative commands that can be used in our everyday life as part of cluster management.</p><h3><strong>Object Creation</strong></h3><p>Imperative commands, objects are created, managed/modified using the CLI. As per <a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/imperative-command/">kubernetes Documentation</a>, the kubectl tool supports creation commands driven by object type.These commands support more object types and are more explicit about their intent, but require users to know the type of objects they intend to create.</p><p>kubectl create &lt;objecttype&gt; [&lt;subtype&gt;] &lt;instancename&gt;</p><p>Some objects types have subtypes that you can specify in the create command. For example, the Service object has several subtypes including ClusterIP, LoadBalancer, and NodePort.</p><pre>kubectl create service nodeport &lt;myservicename&gt;</pre><p>Some of the verb-driven commands are,</p><ul><li>run: Create a new Deployment object to run Containers in one or more Pods.</li><li>expose: Create a new Service object to load balance traffic across Pods.</li><li>autoscale: Create a new auto scale object to automatically horizontally scale a controller, such as a Deployment.</li><li>autoscale: Create a new Autoscaler object to automatically horizontally scale a controller, such as a Deployment.</li></ul><p>For example to create a namespace, a deployment and a service we can use the following CLI commands:</p><pre>kubectl create ns tester<br>kubectl run webserver --image=nginx -n tester<br>kubectl expose deployments webserver --port 8080 --type LoadBalancer -n tester</pre><p>Commands for common update operations include,</p><ul><li>scale: Horizontally scale a controller to add or remove Pods by updating the replica count of the controller.</li><li>annotate: Add or remove an annotation from an object.</li><li>label: Add or remove a label from an object.</li><li>set &lt;field&gt;: Set an aspect of an object.</li></ul><p>For example to set labels on a deployment, scale pods in a deployment, set environment variable, etc, we can use the following CLI commands</p><pre>kubectl label deployment webapp app=frontend<br>kubectl scale --replicas 3 deployment webapp<br>kubectl set env deployment/webapp WHOAMI=&quot;HAL 9000&quot;</pre><ul><li>edit: Directly edit the raw configuration of a live object by opening its configuration in an editor.</li><li>patch: Directly modify specific fields of a live object by using a patch string. For more details on patch strings, see the patch section in <a href="https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#patch-operations">API Convention</a></li></ul><p>We can edit any object in-place using kubectl edit. This will open up the object’s manifest in the default editor:</p><pre>kubectl edit deployment/nginx-deployment<br>kubectl edit svc/nginx-service <em># Edit the service <br></em>KUBE_EDITOR=&quot;nano&quot; kubectl edit pod/nginx  <em># Use an alternative editor</em></pre><p>Using patch, objects field can be updated on the fly without having to open up in editor. patch also allows for more complex updates with various merging and patching strategies. <a href="https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch">Update API Objects in Place Using kubectl patch</a> detailed documentation on patch</p><p>The following command will patch the nginx-deployment object to update the replicas field from 4</p><pre>kubectl patch deployment nginx-deployment -p&#39;{&quot;spec&quot;:{&quot;replicas&quot;:4}}&#39;</pre><h3>Delete Objects</h3><p>delete command can be used to delete an object from a cluster</p><ul><li>delete &lt;type&gt;/&lt;name&gt;</li></ul><p>For example to delete a nginx deployment,</p><pre>kubectl delete deployment/nginx</pre><h3>View Objects</h3><p>Following are the commands for printing information about an object:</p><ul><li>get: Prints basic information about matching objects. Use get -h to see a list of options.</li><li>describe: Prints aggregated detailed information about matching objects.</li><li>logs: Prints the stdout and stderr for a container running in a Pod.</li></ul><p>Use kubectl get to list all Deployments, Replica Sets and Pods in your default namespace:</p><pre>kubectl get deployments # or deploy for shortform<br>kubectl get replicasets # gets replica set<br>kubectl get pods # gets pods</pre><p>To see the object’s state as saved in “etcd”, use the --output option (or -o):</p><pre>kubectl get deployment webapp -o yaml</pre><p>To gather more details, including recent Events (e.g., errors) related to the object, use the kubectl describe command:</p><pre>kubectl describe deployment webapp</pre><p>kubectl logs, can be used to get the logs of a deployment or pods with appropriate parameters to log the same</p><pre>kubectl logs deployment/webapp --since 5m &gt; /tmp/logs.txt<br>grep error /tmp/logs.txt<br># more grep</pre><h3>Additional Commands</h3><h3>Kubectl explain</h3><p>kubectl explain is a kind of built-in documentation for YAML k8s manifest files.</p><pre>kubectl explain pods</pre><h3>Kubectl run — restart flag</h3><p>“kubectl run” command basically creates different workloads/objects based on what is being passed to the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*yglv6TnCDuXcZxfp2xd-Mg.png" /><figcaption>kubectl run flags</figcaption></figure><h3>References</h3><ul><li><a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/imperative-command/">Managing Kubernetes Objects Using Imperative Commands</a></li><li><a href="https://unofficial-kubernetes.readthedocs.io/en/latest/user-guide/kubectl-cheatsheet/">Kubectl cheatsheet - Unofficial Kubernetes</a></li><li><a href="https://medium.com/payscale-tech/imperative-vs-declarative-a-kubernetes-tutorial-4be66c5d8914">Imperative vs. Declarative — a Kubernetes Tutorial</a></li></ul><p><a href="https://medium.com/@nassim.kebbani/how-to-beat-kubernetes-ckad-certification-c84bff8d61b1">https://medium.com/@nassim.kebbani/how-to-beat-kubernetes-ckad-certification-c84bff8d61b1</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9565c25535f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying “Private DockerHub repositories” on a Kubernetes cluster]]></title>
            <link>https://talktopoorni.medium.com/deploying-public-and-private-dockerhub-repositories-on-a-kubernetes-cluster-d8fdb841b82?source=rss-e9030989fa35------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8fdb841b82</guid>
            <category><![CDATA[secrets]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-image]]></category>
            <dc:creator><![CDATA[poornima narasimhan]]></dc:creator>
            <pubDate>Thu, 23 Jan 2020 09:36:41 GMT</pubDate>
            <atom:updated>2020-01-23T09:41:51.453Z</atom:updated>
            <content:encoded><![CDATA[<p>Creating Docker images, deploying containers and orchestrating them is the order of the day. While most of us are familiar with creating public docker images and deploying them in orchestration platforms like Kubernetes, most organizations store proprietary docker images in private registries. While its fairly easy to deploy public docker images to Kubernetes, there are some additional configurations and steps involved when dealing with private images. The intent of this article is to elaborate the steps involved in deploying private images stored in DockerHub in Kubernetes.</p><p>A simple web application can be used as reference for creating docker image and pushing to docker registry. Once the docker image is built push the image to DockerHub and mark the same as private. On a free tier account in DockerHub, we can mark one repository as private, for demonstration / test purpose</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VI4tEkOxEEmySWte_uz1JA.png" /></figure><h4>Pre-requisites</h4><p>Before we begin configuration and steps needed for private registry of DockerHub, we need to have the following in place</p><ul><li>An account in hub.docker.com with appropriate username and password</li><li>A simple application, containerized, pushed to docker hub and marked private</li><li>A Kubernetes cluster and <em>kubectl</em> command-line tool must be configured for communicating within the cluster. If you do not already have a cluster, you can create one by using <a href="https://kubernetes.io/docs/setup/learning-environment/minikube/">Minikube</a>, or you can use one of these Kubernetes playgrounds like Katacoda, Play with Kubernetes etc.</li></ul><h4>Deploying Public Image in DockerHub Registry</h4><p>Kubernetes deploys containers as POD. The deployments are in general based on a “pull” approach. When a container ( containerized app) is to be deployed in a Kubernetes cluster, the container itself is not uploaded to the cluster. Instead, it will pull the docker images to the nodes on its own based on the specification in the deployment YAML file. For example to deploy a container in public registry, the YAML specification will be as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*Xjd-y4VQHckqvKVa3SpYfg.png" /><figcaption>MyDeployment.yml</figcaption></figure><h4>Deploying Private Image in DockerHub Registry</h4><p>When images are marked private in container registry, we need to authenticate our self first by performing</p><p>$ <strong>docker login</strong></p><blockquote>with a username and password. A “config.json” file with an authorization token is created / updated in ~/.docker/config.json. The file can be opened and viewed. If we use a docker credentials store, instead of auth section. credstore details will be present.</blockquote><p>To deploy the private image, the first step is to create a <a href="http://kubernetes.io/docs/user-guide/secrets/">Secret</a> . A Kubernetes cluster uses the secret of <em>docker-registry </em>to authenticate with a container registry to pull an image. The output of above command can be used to create secrets using kubectl command as follows</p><p>$<strong> kubectl create secret generic regcred — from-file=.dockerconfigjson=~/.docker/config.json — type = kubernetes.io/dockerconfigjson</strong></p><p>A word of caution. We need to be sure to create the secret in the namespace in which the application will run as the secrets are specific to a namespace. If we need to deploy to multiple namespaces we need to create a secret for every namespace. With the above command we have successfully set our Docker credentials as a Secret called regcred in the cluster.</p><p>Now we can create deployment using the secret generated above and configuring “<em>imagePullSecrets</em>” in the “<em>spec</em>” section of the deployment and the YAML file will be as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*6ZtUVUIYERLj1MAKOXu__w.png" /><figcaption>MyDeployment.yml</figcaption></figure><p>On performing “kubectl create -f MyDeployment.yml” deployments will get created. “kubectl get pods” should return the POD is in “Running” state. Also deploy a service and verify that you are able to successfully launch the application</p><h4>Git Repository</h4><p>Reference: <a href="https://github.com/poornima1980/MyFirstWebApp">https://github.com/poornima1980/MyFirstWebApp</a> can be used for reference application</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8fdb841b82" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Golang for Internet of Things — A perspective]]></title>
            <link>https://talktopoorni.medium.com/my-2-cents-golang-for-internet-of-things-596de9b1f8df?source=rss-e9030989fa35------2</link>
            <guid isPermaLink="false">https://medium.com/p/596de9b1f8df</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[internet-of-things]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[iot-platform]]></category>
            <category><![CDATA[iot]]></category>
            <dc:creator><![CDATA[poornima narasimhan]]></dc:creator>
            <pubDate>Mon, 23 Dec 2019 12:02:36 GMT</pubDate>
            <atom:updated>2019-12-23T12:04:51.183Z</atom:updated>
            <content:encoded><![CDATA[<h3>Golang for Internet of Things — A perspective</h3><p>Go, also called as Golang,an open source programming language, designed at Google is a statically typed, compiled programming language that it easy to build simple, reliable, and efficient software. Golang with the speed of a compiled language and the feel of an interpreted language is a popular choice for most of the development today. As i started exploring Golang, more from an embedded developer background, I was curious to see its adoption the world of <strong><em>Internet of Things (IoT). </em></strong>I would like to keep this particular write up open for edits, change in perspective and comments as it will be too early to take sides or to draw a logical conclusion</p><h4>Golang for IoT</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*3kkgVJFTCzZRaC_wmDy2FQ.png" /><figcaption>Golang for IoT</figcaption></figure><p>The world of connected devices, driven by Artificial Intelligence is the new normal. The possibility of integrating IoT applications with any and every variant of hardware opens up tons of opportunities to solve several business challenges. Real-time remote monitoring through IoT applications is enabling smart factories, smart cities, smart homes etc.,</p><p>An ideal Internet of Things framework requires a stable, good, quality and dependable programming language. With many tools that are available today, we have 2 or 3 popular options like getting the bare-bone done in C/C++ or to have a NodeJS integration. We need to keep in mind that these programs do not have sufficient modular support as they are made to work only on one particular device and their adaptive characteristics are not strong. Golang with its progressive traits is believed that it can be a good solution for IoT.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*RsPFeIiT8hnNMaoslxTiBQ.png" /><figcaption>Programming Languages for IoT</figcaption></figure><p>A relatively new language, inspired by C without all its dangers, and feel of python (from a developer perspective), built in concurrency ( which corresponds to requirements of huge number of connected devices in IoT networks — by supporting huge number of simultaneous connections) with ability to define go routines that plugs well in to embedded devices. The sweetest deal with Golang is the concurrency model which is much safer and easier to implement, unlike the times that we had to deal with pthreads along with the mutexes, condition variables and semaphores</p><h4>Frameworks</h4><p>As I was spending time to comprehend the adoption of Golang in the world on IoT, I decided to classify the study in terms of adoption at device level, edge, cloud. In addition I also attempted to explore the adoption from Industrial IoT perspective as well. Some popular frameworks that I came across were,</p><p><a href="https://gobot.io/">https://gobot.io/</a> — Golang powered robotics/IoT framework with support for multiple platforms. Interestingly this also has raspberry pi integrated for IoT enthusiast to start with</p><p><a href="https://www.edgexfoundry.org/">https://www.edgexfoundry.org/</a> — A common platform for unifying the IoT edge . Golang replaced Java, reducing the footprint from 2.5 GB of memory to 50 MB. It also made components swap possible, so developers could use their preferred database, plugins, analytics and more</p><p><a href="https://www.flogo.io/">https://www.flogo.io/</a> — Project Flogo — open source framework for event-driven apps, IoT edge etc</p><p><a href="https://github.com/mainflux/">https://github.com/mainflux/</a> — More focused on IIoT</p><p><a href="https://www.scalent.io/">https://www.scalent.io/</a> — Another Golang based IoT</p><p><a href="https://www.gowitek.com/">https://www.gowitek.com/</a> — more focused on real time tacking and predictive analytics</p><p><a href="https://www.thethingsnetwork.org/docs/applications/golang/">https://www.thethingsnetwork.org/docs/applications/golang/</a> — receive activations and uplink messages from devices via The Things Network as well as respond with downlink messages. You can also use the SDK to manage devices.</p><h4>Few things to consider</h4><p>As Golang is primarily called as the language for high performance cloud applications, we overlook the fact that its also a great language for developing Internet of Things devices. The ability to handle requests efficiently, ease of development, a reasonably fair memory foot print and ability to interface well with C, makes go a fairly great alternate to JAVA and other programming languages for IoT</p><p>It is very evident and clear that Golang was not designed to replace embedded C and is not intended to be part of embedded tool chain. The idea of Golang is more towards handling the communication to and from these devices. At a device level, for example, garbage collection in Golang is too much, but it is very good for someone who is seeking greater control of resources without paying too much overhead.</p><p>Golang is in general considered to be very good for data and works very well for data gathering and data distribution to and from various sensors. For example, sorting an entire network of sensors and making use of the data. As said earlier with concurrency in place, and using channels, Golang can help one control an entire set of sensors but at the same time a developer’s glitch can cause the system to go unpredictable (different channels in Golang are not aware of each other)</p><h4>References</h4><ul><li><a href="https://medium.com/mainflux-iot-platform">Mainflux IoT Platform</a></li><li><a href="https://www.techcoffees.com/golang-for-iot-internet-of-things/">Golang for IoT | Internet of Things - Techcoffees</a></li><li><a href="https://www.linux.com/articles/making-the-iot-more-open-a-common-framework-for-iot-edge-computing-with-edgex-foundry/">Making the IoT More Open: A Common Framework for IoT Edge Computing with EdgeX Foundry - Linux.com</a></li><li><a href="https://hologram.io/blog/iot-pay-attention-golang/">Why IoT Should Pay Attention To Go</a></li><li><a href="https://www.gowitek.com/">Golang Development Services | Golang Service</a></li><li><a href="https://itnext.io/getting-go-onto-internet-things-582396ff2760">Getting Go onto Internet of Things</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=596de9b1f8df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developing audio plugin with integrated file player in JUCE]]></title>
            <link>https://talktopoorni.medium.com/developing-audio-plugin-with-integrated-file-player-in-juce-929d5525988d?source=rss-e9030989fa35------2</link>
            <guid isPermaLink="false">https://medium.com/p/929d5525988d</guid>
            <category><![CDATA[dsp]]></category>
            <category><![CDATA[juce]]></category>
            <category><![CDATA[audio-plugin]]></category>
            <category><![CDATA[audio]]></category>
            <category><![CDATA[filters]]></category>
            <dc:creator><![CDATA[poornima narasimhan]]></dc:creator>
            <pubDate>Thu, 21 Nov 2019 08:20:10 GMT</pubDate>
            <atom:updated>2019-11-21T08:20:10.692Z</atom:updated>
            <content:encoded><![CDATA[<p>JUCE is open source (partially) cross platform C++ application framework used for the development of desktop and mobile applications. JUCE is used in particular for the feature rich GUI and plugins. JUCE offers a large set of audio functionality making it a popular framework compared to other similar frameworks. JUCE has support for audio devices ( such as CoreAudio, ASIO, ALSA, JACK, WASAPI, DirectSound), MIDI playback, built-in readers for common audio file formats ( such as WAV, AIFF, FLAC, MP3 and Vorbis). This also provides wrappers for building various types of audio plugin such as VST effects and instruments. You can build VST, VST3, AU, RTAS and AAX format plugins with ease, and host VST and AU plugins inside your own applications</p><p>As i write this I would like to thank <a href="https://theaudioprogrammer.com/">https://theaudioprogrammer.com/</a> and JUCE tutorials for providing immense insight into the architecture and development in JUCE.</p><p>Interestingly when i was trying to explore JUCE framework and<strong> develop audio plugins my intent was to create a standalone plugin in which i can read an audio file, perform some filtering on the same and playback the file.</strong> This has to happen in real time and I did not find sufficient example or tutorial encapsulating the same. As i struggled for sometime to get this pipe working I would like to share my learning through this article.The <a href="https://theaudioprogrammer.com/">https://theaudioprogrammer.com/</a> suggest to using <a href="https://github.com/jonathonracz/AudioFilePlayerPlugin">https://github.com/jonathonracz/AudioFilePlayerPlugin</a> for audio playback and then connect them using “AudioPluginHost” with the DSP Audio plugin that we create.</p><h3>Installation and project creation in windows</h3><ul><li><strong>Step 1</strong>. I used Visual Studio 2017 for development using JUCE framework.</li><li><strong>Step 2.</strong> Download JUCE 5.4.5 from <a href="https://www.juce.com/get-juce">here</a> and setup JUCE</li><li><strong>Step 3</strong>. Open Projucer and create “Audio Plugin”</li><li><strong>Step 4</strong>. Open your project in Visual Studio and start implementing the same as shown in figure.</li><li><strong>Step 5. </strong>Include “juce_dsp” module in modules section as we will be passing audio through the dsp filter in this example</li></ul><h3>Create a project “Audio Plugin” with Projucer</h3><p><a href="https://juce.com/">https://juce.com/</a> has detailed tutorials for creating projects with projucer and configuring the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*adJRpJyY8lap8bzi1SJ_dQ.png" /><figcaption>ProJucer — JUCE</figcaption></figure><p>As we decided to build plugin with DSP filter functionality, add “JUCE_DSP” modules also to the project as shown</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FRx344U56RtDt2TDsOd9wA.png" /></figure><p>Once the project is created there will be 4 files created namely, PluginEditor.h, PluginEditor.cpp, PluginProcessor.h, PluginProcessor.cpp. The UI customisations can be added to PluginEditor.cpp and PluginEditor.h files. I used <a href="https://docs.juce.com/master/tutorial_playing_sound_files.html">https://docs.juce.com/master/tutorial_playing_sound_files.html</a> build a simple audio player for opening a wav file, playing audio and stopping playback. This works well and i was able to open audio, play and stop appropriately. The “<strong>AudioFormatReaderSource</strong>” object connected to “<strong>AudioTransportSource</strong>” object was used to play the sound. We can loop the file playing as well. All the logic was implemented in “PluginEditor” files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*d6Kzx4t8D6EX_RClglQ_aQ.png" /><figcaption>Audio Player</figcaption></figure><p>Now i was interested in feeding this read audio samples to the “<strong>DSP module”</strong> and was finding ways to do the same. So in the process block of “<strong>PluginProcessor</strong>” i need to get the samples of audio. The following snippet helped me in achieving the same</p><blockquote><strong>void AudioProcessor::processBlock (AudioBuffer&lt;float&gt;&amp; buffer, MidiBuffer&amp; midiMessages)</strong></blockquote><blockquote>{</blockquote><blockquote>auto totalNumInputChannels = getTotalNumInputChannels();</blockquote><blockquote>auto totalNumOutputChannels = getTotalNumOutputChannels();</blockquote><blockquote>for (auto i = totalNumInputChannels; i &lt; totalNumOutputChannels; ++i)</blockquote><blockquote>buffer.clear(i, 0, buffer.getNumSamples());</blockquote><blockquote><strong>transportSource.getNextAudioBlock(AudioSourceChannelInfo(buffer));</strong></blockquote><blockquote>for (int channel = 0; channel &lt; totalNumInputChannels; ++channel)</blockquote><blockquote>{</blockquote><blockquote><strong>//DSP Filtering code comes here</strong></blockquote><blockquote>}</blockquote><blockquote>}</blockquote><p>The standalone plugin looks like the following.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*NYqifomamHG-_WOvQ5U2ow.png" /><figcaption>Audio Plugin with Integrated File Reader</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=929d5525988d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Invoking Google Cloud Platform (GCP) API from AWS Lambda]]></title>
            <link>https://talktopoorni.medium.com/invoking-google-cloud-platform-gcp-api-from-aws-lambda-417547cf3f3e?source=rss-e9030989fa35------2</link>
            <guid isPermaLink="false">https://medium.com/p/417547cf3f3e</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[google-cloud-vision-api]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <dc:creator><![CDATA[poornima narasimhan]]></dc:creator>
            <pubDate>Wed, 07 Aug 2019 08:17:22 GMT</pubDate>
            <atom:updated>2019-08-07T08:17:22.071Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Invoking Google Cloud Platform (GCP) API from AWS Lambda</strong></p><p>Interestingly I was trying to experiment text detection, OCR, with various tools in the open source and was trying to compare their results and performances in various kind of documents both digital and handwritten. During this process I was inspired by the way google cloud vision out performed other text detection tools that were available.</p><p>As I was developing my entire engine in AWS Lambda I was curious to call google cloud vision API from AWS Lambda. I did hit a lot of roadblocks and finally was successful to call google cloud services from AWS which motivated me to write this article.</p><p>This article assumes that the reader is familiar with AWS, Lambda and serverless concepts.</p><p><strong>Text Detection — Function</strong></p><p>The Google Cloud Vision API enables a variety of detection like objects, text, OCR etc. It takes complex machine learning models focused around image recognition and formats it in a simple REST API interface that can be called from anywhere with proper authentication. Internally the Cloud Vision API uses a pre-trained model trained on a large dataset of images.</p><p>For the purpose of this article, we will contain ourselves on text detection capability of Google Cloud Vision API and provide you with steps to invoke the same from AWS lambda. The python code below can be used for text detection using google cloud vision API.</p><pre>function.py</pre><pre>from google.cloud import vision<br>from google.cloud.vision import types<br>import io<br>from PIL import Image<br>from PIL import ImageDraw<br>from enum import Enum<br>import os<br>import json</pre><pre>image_file  = &quot;test.jpg&quot;<br>image  = Image.open(image_file)</pre><pre>os.environ[&quot;GOOGLE_APPLICATION_CREDENTIALS&quot;]=&quot;first.json&quot;</pre><pre>def lambda_handler(event, context):<br>    client = vision.ImageAnnotatorClient()<br>    with io.open(image_file, &#39;rb&#39;) as image_file1:<br>         content = image_file1.read()</pre><pre>    content_image=types.Image(content=content)<br>    response=client.document_text_detection(image=content_image)<br>    texts=[text.description for text in response.text_annotations]<br>    print(texts[0])</pre><p><strong>Authentication</strong></p><p><em>Authentication, as per google, </em>refers to the process of determining a users or client’s identity. <em>Authorization</em> refers to the process of determining what permissions an authenticated client has for a set of resources. That is, authentication refers to who you are, and authorization refers to what you can do.</p><p>For authentication, google recommends using something called “<em>service account”.</em>Refer to <a href="https://cloud.google.com/docs/authentication/getting-started">https://cloud.google.com/docs/authentication/getting-started</a> for creating service accounts in Google Cloud Platform. Its a Google account that is associated with your GCP project, as opposed to a specific user. Service accounts can be used for authentication regardless of where your code runs (locally, Compute Engine, App Engine, on premises, etc.).</p><p>After creating service account, download a corresponding JSON credentials file and setting the environmental variable of JSON file path to GOOGLE_APPLICATION_CREDENTIALS</p><pre>os.environ[“GOOGLE_APPLICATION_CREDENTIALS”]=”Authenticate.json”</pre><p><strong>After </strong><a href="https://cloud.google.com/docs/authentication/getting-started#setting_the_environment_variable"><strong>setting the environment variable</strong></a><strong>, you don’t need to explicitly specify your credentials in code when using a Google Cloud Client Library.</strong> The client library can determine your credentials implicitly.If the request succeeds, authentication works.</p><p><strong>Deployment Package for AWS Lambda</strong></p><p>A deployment package is nothing but a zip archive that contains our function code and dependencies. Lambda Console editor manages the deployment package when we author our function by default. This method is perfectly fine as long as we don’t need to add any libraries..In our case we need to invoke google cloud vision API from Lamba like (python),</p><pre>from google.cloud import vision<br>from google.cloud.vision import types</pre><p>Deployment package can be created if you plan to use the Lambda API to manage functions or if you need to include libraries and dependencies other than the AWS SDK. The deployment package can be directly uploaded to lambda or S3 bucket.</p><p><a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html#python-package-venv">https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html#python-package-venv</a> elaborates the various methods of creating deployment package in python. I launched a EC2 instance to create my deployment package. As i was using python3.7, the built in <a href="https://docs.python.org/3/library/venv.html">venv module</a> can be used to create a virtual environment instead of virtualenv as show below. The steps involved are,</p><ol><li>Create virtual environment</li><li>Activate the environment</li><li>Install libraries with pip [install all libraries that are required for import]</li><li>Deactivate the virtual environment</li><li>Create zip archive with contents of library</li><li>Add your function code to the archive</li></ol><pre>~/my-testfunction$ <strong>python3 -m venv gcpenv</strong></pre><pre>~/my-testfunction$ <strong>source gcpenv/bin/activate</strong> </pre><pre>(gcpenv)~/my-testfunction$ <strong>pip install google-cloud-vision</strong></pre><pre>(gcpenv)~/my-testfunction$ <strong>deactivate</strong></pre><pre>~/my-testfunction$ <strong>cd ../gcpenv/lib/python3.7/site-packages</strong></pre><pre>~/my-testfunction$ <strong>cd ../gcpenv/lib/python3.7/site-packages</strong></pre><pre>~/gcpenv/lib/python3.7/site-packages$ <strong>zip -r9 ${OLDPWD}mytestproject.zip .</strong></pre><pre>~/gcpenv/lib/python3.7/site-packages$ <strong>cd $OLDPWD</strong></pre><pre>~/my-testfunction$ <strong>zip -g mytestproject.zip function.py</strong></pre><p>Depending on the library, dependencies may appear in either site-packages or dist-packages, and the first folder in the virtual environment may be lib or lib64. You can use the pip show command to locate a specific package.</p><p><strong>Deploy in Lambda</strong></p><p>Once the deployment package is created, on the AWS console or CLI update the function code. I have used AWS console as shown below. The Handler tab highlighted below, takes the format of The filename.handler-method value in your function. For example, “function.handler” calls the handler method defined in function.py.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*6UCN0181m6ekSPIuBhpw9A.png" /></figure><p>I hope this article helps with understanding the Google Cloud API using Python and AWS Lambda.If you’ve tried the above and have any feedback, let me know what you think <a href="https://medium.com/u/e9030989fa35">poornima narasimhan</a> and here are some links to everything I’ve discussed in this post:</p><ul><li><a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html#python-package-venv">https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html#python-package-venv</a></li><li><a href="https://cloud.google.com/vision/docs/">Vision API documentation</a></li><li><a href="https://docs.aws.amazon.com/lambda/latest/dg/welcome.html">https://docs.aws.amazon.com/lambda/latest/dg/welcome.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=417547cf3f3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>