<?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 Tushar Srivastava on Medium]]></title>
        <description><![CDATA[Stories by Tushar Srivastava on Medium]]></description>
        <link>https://medium.com/@tusharsri?source=rss-fa72077055f1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*5VepbpIO9a72-LEUrmxXbg.jpeg</url>
            <title>Stories by Tushar Srivastava on Medium</title>
            <link>https://medium.com/@tusharsri?source=rss-fa72077055f1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 20:19:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tusharsri/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[Evolution of Programmatic advertising]]></title>
            <link>https://medium.com/@tusharsri/evolution-of-programmatic-advertising-ede7a0cad276?source=rss-fa72077055f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ede7a0cad276</guid>
            <category><![CDATA[advertising]]></category>
            <category><![CDATA[rtb]]></category>
            <category><![CDATA[ssp]]></category>
            <category><![CDATA[dsp]]></category>
            <category><![CDATA[advertising-technology]]></category>
            <dc:creator><![CDATA[Tushar Srivastava]]></dc:creator>
            <pubDate>Tue, 25 Jul 2023 04:31:46 GMT</pubDate>
            <atom:updated>2023-07-30T08:00:09.516Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever wonder when you start searching for a specific product on a browser or mobile how you always get relevant ads? There are lots of parties involved to provide you with a better experience. I will try to elaborate on the whole process.</p><p>Before we deep dive into the evolution of programmatic advertising let us understand who the consumers and suppliers are in this marketplace.</p><h3>Advertisers</h3><p>These are the product owners who want to maximize their product purchases and create constant demand in the market for their products.</p><p>Let us take Samsung as a product owner and its mobiles/Tabs/Watches as products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*lAkJl1nMjKYu8022uGHOSQ.png" /><figcaption>Example of Advertisers</figcaption></figure><h3>Publishers</h3><p>These are the people who are owners of either mobile applications or websites where they can show any advertisements to their audience or recurring consumers.</p><p>We can consider the Facebook website as a publisher where ads can be shown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sPxcH5L77Wuy73fPuYJDmw.png" /><figcaption>Example of publishing platforms</figcaption></figure><h3>Contract Establishment</h3><p>In the early days publishers and Advertisers used to connect to establish a contract where they could mention terms before using ad slots.</p><p>Let us take an example, Samsung can establish a contract with Facebook where Samsung can provide the ads and Facebook can showcase these ads to its users. This way Samsung can increase its product awareness and can get more buyers which in return will provide more profit.</p><blockquote>The ad slots or space which Facebook is providing to Samsung is called as Inventory. So officially Facebook is selling its inventory to Samsung.</blockquote><p>The process was working fine but there were some cons hence process improvement was required.</p><ol><li>To connect with multiple publishers the advertiser needs to establish and maintain multiple contracts.</li><li>Advertisers used to always look for big publishers(Publishers with huge traffic) hence less scope was there for small publishers to survive who were having less traffic on their website.</li></ol><h3>Ad Network</h3><p>To overcome the above issues an Ad network was established.</p><p>Collectively small and big publishers registered to Ad Network. This way a diversified bulk inventory was created for advertisers to choose from. Advertisers will pay to Ad Network and Ad Network will be paying to Publishers. It provided great support to Publishers with less traffic as now they can also be part of monetization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ym_U2AxBCKyistB8tX5sdw.jpeg" /><figcaption>Reference image of Ad network</figcaption></figure><p>Advertisers can now have only 1 contract with the Ad network and as per the requirement, the Ad network will make the contract with n number of publishers and provide different inventories to Advertisers.</p><p>A new problem arose when multiple Ad Networks came into the picture, this again arose the work management for Advertisers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYy1NjuFx40vaTit4pADaw.jpeg" /><figcaption>Reference image of how ad network interacts with Advertisers and Publishers</figcaption></figure><h3>Ad Exchange</h3><p>Ad Exchange supported resolving the above issue. They clubbed all the Ad Networks together to get overall inventory and Advertisers can again have 1 contract with Ad Exchange to get multiple Publishers and a huge number of inventories. But Ad Exchange was a Data Driven Platform hence some platform was required which can connect Advertisers to Ad Exchange and then Ad Exchange to Ad Networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CG2yvFtstQwZo26xWygBmw.jpeg" /><figcaption>Example image of ad exchange</figcaption></figure><h3>Demand Side Platform</h3><p>DSP completes Advertisers and Ad Exchange connection. Advertisers can easily create criteria on which they need to identify publishers and showcase their product ads. DSP buys ad impressions at the best possible prices automatically.</p><p>Within DSP Advertisers can set creative images, tests, and other content to keep their Ads ready.</p><p>DSP platform can also support bid optimization according to different parameters received from the SSP side.</p><p>Last but not least would be audience targeting done from the DSP platform by Advertisers.</p><h3>Supply Side platform</h3><p>It resides between AD Exchange and Ad Networks. SSP is the one who approves or rejects the advertiser&#39;s bids on ad impression based on, which advertiser is providing the highest price. All this happens programmatically within milliseconds.</p><p>Its main functionalities are:</p><ol><li>Run a real-time auction to serve ads</li><li>Evaluate the advertisers</li></ol><p>SSP offers ad impressions to DSP and DSP decides whether to buy the inventory based on criteria setup.</p><h3>Campaign setups</h3><p>With Campaign setup, Advertisers define the selection process of Publishers for their product ad showcase. There are multiple criteria which include geographic location, language, etc., to improve campaign performance and optimization.</p><p>If Samsung&#39;s new phone is launched in the Asia region then advertisers can choose only Asia region publishers by doing small changes in the campaign. Imagine what will happen to profit and sales if Samsung&#39;s new smartphone being launched is done in the Asia region and ads are published in Europe region with publishers having access to only Europe users.</p><h3>Programmatic Guarantee Advertisement</h3><p>When 1 Advertiser wants to collaborate with 1 Publisher to showcase their ads, All the transactions happen online programmatically hence on physical connection is required.</p><h3>Private Market Place</h3><p>When the Publisher agrees to sell the inventory to only a few Advertisers.</p><h3>RTB/Open auction</h3><p>When the Publisher allows all the Advertisers to bid for the inventory, Of course, there will be restrictions for a few ads like unethical work, Alcohol, etc. This depends on what the Publisher allows on his ad slots.</p><p>Multiple advertisers compete with each other and place bids for the same inventory, the advertiser with the highest bid wins the inventory and their ads are shown on the publisher&#39;s website.</p><p>Let us assume you are opening a website and that website (Publisher) has having ad slot (Inventory). Before the page opens website will send a request to the SSP provider with ad slot size. SSP will analyze your request which contains some important information like demography, cookies, Interests, etc. SSP takes the data and provides it to AD Exchange, DSP which is added to Ad Exchange provides bids on the ad slot with their previous stats. SSP reads the bids from the auction provided by DSP and provides the ad slot to the most relevant + higher bidder. That advertiser wins the ad slot and gets to showcase their product ad on the website you are opening. Hence when the website loads you see the most relevant ad.</p><p>This whole process takes place in milliseconds hence you will not notice any delay in ad selection or ad loading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KCTeRMaljY0Rit9jlhSksg.jpeg" /><figcaption>Working process of ad exchange with Ad networks and Advertisers</figcaption></figure><h3>Data Management Platform</h3><p>This is one of the most important platforms when it comes to data warehousing for advertising. User profiles(Devices) are maintained here which helps Advertisers and Publishers identify potential customers.</p><blockquote>By User profile I mean device ids and not individual person. DMP stores mobile cookies, desktop cookies, android id ADID and identifier for apple IDFA.</blockquote><p>If you have been searching for a mobile phone in recent weeks then it will be a good decision to showcase your ads related to the latest smartphones available for purchase. This is commonly referred to as Granular targeting and the reason behind using this is very good ROI.</p><p>Advertisers can buy this data from DMP to identify their potential customers and add this vital information to the campaign inside the DSP platform. This way ads will be shown to only relevant audiences and support in sales increase. They can also use this data for user explorer reports.</p><p>Publishers can also buy DMP data and can use it to personalize the content to specific users. Publishers can use DMP data and extract which users are interested in shopping for clothes and then can showcase ads related to shopping or sales on their websites.</p><h3>Customer Data Platform</h3><p>CDP is also a data warehouse. It holds customer information as known IDs because of 1st party data. Data taken from here can be used with machine learning to improve accuracy. CDP removes the data fragmentation issue that was faced by DMP.</p><p>Once the profile unification, data cleaning, and duplicity are removed the data is ready as User profile stitching. These user profiles help in improving customer retention, new lead generation, and lapsed customers. More relevant ads can be shown to customers which can eventually provide him a better experience and can provide better ROI to the whole business.</p><h4>Conclusion</h4><p>I hope I was able to provide you with some new insights from the ads domain and programmatic advertising.</p><p>Please find below some references that can be used by new publishers in order to integrate the Ads kit.</p><h4>Reference</h4><p><a href="https://developer.huawei.com/consumer/en/hms/huawei-adskit/">Ads Kit - HUAWEI Ads Publisher Service - HUAWEI Developer</a></p><p>Thank You for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ede7a0cad276" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Login, SignUp, Splash, and Welcome screens using Jetpack Compose]]></title>
            <link>https://medium.com/@tusharsri/building-login-signup-splash-and-welcome-screens-using-jetpack-compose-2237b74ca72a?source=rss-fa72077055f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2237b74ca72a</guid>
            <category><![CDATA[jetpack-compose-tutorial]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Tushar Srivastava]]></dc:creator>
            <pubDate>Wed, 12 Apr 2023 20:36:14 GMT</pubDate>
            <atom:updated>2023-07-30T12:59:44.265Z</atom:updated>
            <content:encoded><![CDATA[<p>Jetpack Compose provides a declarative way of building UI components using Kotlin, simplifying the development process and making it more efficient.<br>Unlike the traditional Android UI toolkit, Jetpack Compose allows developers to build UI components without XML or the need for separate layout files which are easy to read, maintain, and test. It uses a functional programming model that enables developers to create reusable components that can be easily composed together to form a complete UI.<br>In this article, we will explore how to start building UI components using Jetpack Compose.</p><blockquote>Creating Splash Screen for your application.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2fTcZc2-H89mr5kwIbNsjA.png" /><figcaption>Splash Screen</figcaption></figure><p>The splash screen is an important part of the user experience as it is the first thing users see when they launch your app. Here are some best practices for designing and implementing a splash screen.</p><ol><li>Keep it Simple, clean, and minimalistic. Avoid overloading it with too much information or too many graphics.</li><li>The splash screen is a great opportunity to showcase your brand. Use your brand colors, logo, and typography to create a strong visual impact.</li><li>Users don’t like waiting, so keep your splash screen short and to the point. As a general rule of thumb, a splash screen should not take more than 3–4 seconds to load.</li></ol><p>In order to add a splash screen with the gradient you can use the below code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47c6c9f3c8089aa7323613660dc723ad/href">https://medium.com/media/47c6c9f3c8089aa7323613660dc723ad/href</a></iframe><p>Splash Screen code walkthrough</p><p>TBC</p><blockquote>The Gradient effect in detail</blockquote><p>TBC</p><blockquote>Welcome Screen for users</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7_WTTZPuBbYQf3IYqKKkaw.png" /><figcaption>Welcome Screen</figcaption></figure><p>TBC</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/171ee7360db434fff23df79ca5dc89d1/href">https://medium.com/media/171ee7360db434fff23df79ca5dc89d1/href</a></iframe><p>Welcome Screen code walkthrough</p><p>TBC</p><blockquote>Adding a Sign Up Screen for new users</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ROjlR_Js69UwHciMrT-H6A.png" /><figcaption>Sign Up Screen</figcaption></figure><p>TBC</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3635994f878211d9d7e5453bf66b43f0/href">https://medium.com/media/3635994f878211d9d7e5453bf66b43f0/href</a></iframe><p>Sign-Up screen code walkthrough</p><p>TBC</p><blockquote>Adding a Login screen for returning user</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*az8DS6B2EUy_BfwvviRvbQ.png" /><figcaption>Composable Sign In screen</figcaption></figure><p>TBC</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f2fdc2cd47b918aa00de604850453df3/href">https://medium.com/media/f2fdc2cd47b918aa00de604850453df3/href</a></iframe><p>Welcome Screen code walkthrough</p><p>TBC</p><h4>Conclusion</h4><p>Jetpack Compose is a revolutionary UI toolkit for Android that simplifies and streamlines the UI development process. With Jetpack Compose, developers can build high-quality and performant UIs using a declarative and composable approach. This approach allows for more efficient and intuitive coding, leading to faster and more reliable UI development. By adopting Jetpack Compose, developers can accelerate the UI development process, increase productivity, and create more robust, scalable, and user-friendly apps for Android users.</p><p>In the following article, we’ll be taking a deep dive into the Navigation API and how to use it to manage the navigation flow of your app. We’ll also cover best practices for designing and implementing navigation in your app, and how to leverage the Navigation API’s advanced capabilities, such as argument passing and Nested navigation. Whether you’re a beginner or an experienced Android developer, this article will provide you with valuable insights into the Navigation API and help you build more robust and scalable apps.</p><h4>Reference</h4><p><a href="https://developer.android.com/jetpack/compose">Jetpack Compose UI App Development Toolkit - Android Developers</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2237b74ca72a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning made Easy: — Automatic Speech Recognition using Kotlin and Huawei ML Kit]]></title>
            <link>https://medium.com/@tusharsri/machine-learning-made-easy-automatic-speech-recognition-using-kotlin-and-huawei-ml-kit-9bb715fc93af?source=rss-fa72077055f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bb715fc93af</guid>
            <category><![CDATA[huawei-mobile-service]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ml-kit]]></category>
            <dc:creator><![CDATA[Tushar Srivastava]]></dc:creator>
            <pubDate>Fri, 25 Sep 2020 11:11:35 GMT</pubDate>
            <atom:updated>2020-09-25T11:11:35.159Z</atom:updated>
            <content:encoded><![CDATA[<h3>Machine Learning made Easy: — Automatic Speech Recognition using Kotlin and Huawei ML Kit</h3><h3>Introduction</h3><p>ASR or Automatic Speech Recognition can recognize speech and convert it into text.</p><p>There are other speech recognition models available in market but why to use them when your application can itself handle all the calls.</p><p>This will even make sure data accumulation of your customer in your application only.</p><p>A maximum of 60 seconds can be covered with deep learning models which are having accuracy of over 95%.</p><p>Currently English and Mandarin Chinese are supported.</p><p>ASR depends on on-Cloud speech recognition so device should be connected to internet.</p><h3>Article Takeaway</h3><p>Below is the final result which we will be going to achieve after implementing this Kit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*p2uOoMqI2cV4uLyV410-XQ.gif" /></figure><h3>Steps To Integrate</h3><p><strong>Step 1:</strong> Create a new project in Android Studio</p><p><strong>Step 2:</strong> Add the below dependencies into app.gradle file</p><p>implementation &#39;com.huawei.hms:ml-computer-voice-asr-plugin:1.0.4.300&#39;</p><p><strong>Step 3:</strong> Add agc plugin in the top of app.gradle file</p><p>apply plugin: &#39;com.huawei.agconnect&#39;</p><p><strong>Step 4:</strong> Add the below permissions in manifest file</p><p>&lt;<strong>uses-permission</strong> android:name=&quot;android.permission.INTERNET&quot; /&gt;</p><p>&lt;<strong>uses-permission</strong> android:name=&quot;android.permission.RECORD_AUDIO&quot; /&gt;</p><p><strong>Step 5:</strong> Add the below method in your activity and call it on click of a button.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/974f2327b83639eb37c7a5eb88ef1d07/href">https://medium.com/media/974f2327b83639eb37c7a5eb88ef1d07/href</a></iframe><h3>Let us discus this in detail.</h3><p>We are starting an activity <strong>MLAsrCaptureActivity</strong> and provides it with 2 parameters.</p><p><strong>MLAsrCaptureConstants.LANGUAGE</strong> as <strong>“en-US”</strong>, Default will set it to English</p><p><strong>MLAsrCaptureConstants.FEATURE</strong> is set to <strong>MLAsrCaptureConstants.FEATURE_WORDFLUX</strong>.</p><p><strong>MLAsrCaptureConstants.FEATURE_WORDFLUX</strong> means text will be displayed on speech pickup UI</p><p><strong>MLAsrCaptureConstants.FEATURE_ALLINONE</strong> means it will not display text on speech pickup UI</p><p><strong>Step 6:</strong> override <strong>onActivityresult()</strong> method.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53b29c0201bd1cd4e8c7c39bdec7a398/href">https://medium.com/media/53b29c0201bd1cd4e8c7c39bdec7a398/href</a></iframe><h3>Let us discus this in detail.</h3><p><strong>onActivityResult()</strong> will yield you success and failure cases.</p><p><strong>MLAsrCaptureConstants.ASR_SUCCESS</strong></p><p>Data will come as text under bundle with key as “<strong>MLAsrCaptureConstants.ASR_RESULT</strong>”</p><p>To fetch it use below code.</p><p><strong>text = bundle.getString(MLAsrCaptureConstants.ASR_RESULT).toString()</strong></p><p><strong>MLAsrCaptureConstants.ASR_FAILURE</strong></p><p>If it falls under error category then you can fetch details as shown below.</p><p><strong>MLAsrCaptureConstants.ASR_ERROR_CODE</strong> is the key for error code</p><p><strong>MLAsrCaptureConstants.ASR_ERROR_MESSAGE</strong> is the key for error message</p><p>There are different type of messages stored which cover-up different scenarios in order to get successful result. They can notify your user in order to get best results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vlW_1XAiAfXsFal_.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*htpqor9XwemszzMo.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N4GpFSytsQCj2l3M.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KFbOPufnweJzIVKL.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*T-4LxDB1R3E0zK9k.png" /></figure><h3>FAQ</h3><p>Is the result Realtime?</p><p>Yes the result provided is Realtime.</p><h3>Conclusion</h3><p>I hope you liked this article. I would love to hear your ideas on how you can use this kit in your Applications.</p><p><strong>Read my other articles on ML Kit</strong></p><p><strong>Image Segmentation :</strong></p><p><a href="https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201229683997600043&amp;fid=0101187876626530001">HUAWEI Developer Forum</a></p><p><strong>Text Translation :</strong></p><p><a href="https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201230472937060047&amp;fid=0101187876626530001">HUAWEI Developer Forum</a></p><p><strong>Text Recognition :</strong></p><p><a href="https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201236478929600089&amp;fid=0101187876626530001">HUAWEI Developer Forum</a></p><p><strong>Bank Card Recognition :</strong></p><ul><li><a href="https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201261566832050274&amp;fid=0101187876626530001">HUAWEI Developer Forum</a></li><li><a href="https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/ml-introduction-4">Document</a></li></ul><p><strong>For code labs practice</strong></p><p><a href="https://developer.huawei.com/consumer/en/codelab/HUAWEIMLKitFaceDetectionKit/index.html#0">ML Kit (Face Detection)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bb715fc93af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning made Easy :- Image Segmentation using Kotlin, MVVM, Data Binding and Huawei ML Kit]]></title>
            <link>https://medium.com/@tusharsri/machine-learning-made-easy-image-segmentation-using-kotlin-mvvm-data-binding-and-huawei-ml-kit-2b845ef38f06?source=rss-fa72077055f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b845ef38f06</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[huawei-mobile-service]]></category>
            <dc:creator><![CDATA[Tushar Srivastava]]></dc:creator>
            <pubDate>Fri, 18 Sep 2020 13:06:54 GMT</pubDate>
            <atom:updated>2020-09-18T13:06:54.540Z</atom:updated>
            <content:encoded><![CDATA[<h3>Machine Learning made Easy :- Image Segmentation using Kotlin, MVVM, Data Binding and Huawei ML Kit</h3><h3>Introduction</h3><p><strong>Image Segmentation</strong> — This service can extract segments from image. In this service static image form camera and gallery both are supported and it also supports dynamic camera streams.</p><p>Internally it uses <strong>Mean Intersection-Over-Union</strong> which is a common evaluation metric for semantic image segmentation.</p><p>Once segmentation is done it can create coordinate array of each element like human, plant animal etc. Once you get this array you can replace any value with other one to create some wonderful results.</p><p>Here we will learn on how we can extract a user from an image, change his background and create a new wonderful result using Huawei ML Kit.</p><p>I will divide this process in 4 steps</p><p>1. How to choose an image from gallery or camera</p><p>2. Once we get the result how to send it to Huawei ML Kit</p><p>3. How to complete the processing of image with desired result</p><p>4. How to showcase newly extracted image onto the screen</p><h3>Just to make things excited here is a sample image and its final result.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AqGinouyhaNQ6f0J.png" /></figure><p>Have you noticed how easy it is to select an image and change its background as per our choice.</p><p>One more thing to notice here is how sharp the selection was and which results to how clear the extracted image is looking.</p><p>Once we get the segmented image we can create different results as well.</p><h3>So let’s get to the point</h3><h3>Step 1:</h3><p>To choose an image from gallery or camera use the below code.</p><p><strong>By Camera:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7e3fd0f4fb861c697429af1fed294d00/href">https://medium.com/media/7e3fd0f4fb861c697429af1fed294d00/href</a></iframe><p><strong>By Gallery:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb33cbb9e4a0fb249086e6e9b312df3a/href">https://medium.com/media/bb33cbb9e4a0fb249086e6e9b312df3a/href</a></iframe><p><strong>Step 2:</strong></p><p>Once the intent is triggered you will be directed to system activities and you have to choose an image.</p><p>The control once again comes back to our <strong>ImageSegmentActivity</strong> in <strong>onActivityResult</strong> method.</p><p>We have to get the bitmap and save it for future use. Below is the code for reference.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5e7ddbbb1c4a6e6d5c592e7d77c17618/href">https://medium.com/media/5e7ddbbb1c4a6e6d5c592e7d77c17618/href</a></iframe><p><strong>Step 3:</strong></p><p>After getting the bitmap I am setting a <strong>MutableLiveData</strong> which is present in my <strong>ImageSegmentationViewModel</strong> and calling<strong> imageSegmentation()</strong> method.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f8243c92839660408b3db29b331312d/href">https://medium.com/media/2f8243c92839660408b3db29b331312d/href</a></iframe><p><strong>Let us discus about above used line of code in detail</strong></p><p>Before we create <strong>MLImageSegmentationAnalyzer </strong>and as we need to tune our settings to get a desired result, Hence below settings are been changed in order to extract fast human body segment from the image.</p><p>Once this <strong>MLImageSegmentationSetting </strong>object is created for tuning we will pass this to <strong>MLImageSegmentationAnalyzer</strong>.</p><ul><li><strong>setExact(False) : True </strong>is whether you want fine segmentation and <strong>False</strong> is fast segmentation.</li><li><strong>setAnalyzerType(MLImageSegmentationSetting.BODY_SEG) :</strong> Setting the mode to identify and extract body from image.</li><li><strong>setScene(MLImageSegmentationScene.ALL) : </strong>On a whole we can extract 4 scenes from image which are mentioned below with their key as well.</li></ul><ol><li><strong>MLImageSegmentationScene.ALL: </strong>All segmentation results are returned (pixel-level label information, human body image with a transparent background, and gray-scale image with a white human body and black background).</li><li><strong>MLImageSegmentationScene.MASK_ONLY:</strong> Only pixel-level label information is returned.</li><li><strong>MLImageSegmentationScene.FOREGROUND_ONLY</strong>: Only a human body image with a transparent background is returned.</li><li><strong>MLImageSegmentationScene.GRAYSCALE_ONLY</strong>: Only a gray-scale image with a white human body and black background is returned.</li></ol><p>For our example we are using <strong>MLImageSegmentationScene.ALL </strong>as we want all the scenes from the image.</p><p>Finally above created <strong>MLImageSegmentationSetting </strong>object we will be providing to <strong>MLImageSegmentationAnalyzer</strong></p><ul><li><strong>MLImageSegmentationAnalyzer analyzer = MLAnalyzerFactory.getInstance().getImageSegmentationAnalyzer(setting);</strong></li></ul><h3>We can also create MLImageSegmentationAnalyzer object by calling below code as well.</h3><ul><li><strong>MLImageSegmentationAnalyzer analyzer = MLAnalyzerFactory.getInstance().getImageSegmentationAnalyzer();</strong></li></ul><p>But in this code customization is very limited.</p><p>Next step is to create an <strong>MLFrame </strong>by below code and ptovide your previously fetched image in bitmap format.</p><ul><li><strong>MLFrame frame = MLFrame.fromBitmap(bitmap);</strong></li></ul><p>On analyser object we will be calling <strong>asyncAnalyseFrame(frame)</strong> and providing <strong>MLFrame </strong>which we recently created.</p><p>This will yield you a <strong>Task&lt;MLImageSegmentation&gt;</strong> object, on this object you will get 2 callbacks.</p><ul><li><strong>onSuccess</strong></li><li><strong>onFailure</strong></li></ul><p>You can save the new resource from <strong>onSuccess()</strong> and stop the <strong>analyzer </strong>to release detection resources by <strong>analyzer.stop()</strong> method.</p><p><strong>Step 4:</strong></p><p>Here is how we can set bitmap to imageview</p><ul><li>Inside our main layout <strong>view model</strong> was added with name as <strong>dashboardViewModel</strong></li><li>We also added a custom tag named as <strong>customImageSrc</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5e5b229e799420e9d0d7aab29e52d3eb/href">https://medium.com/media/5e5b229e799420e9d0d7aab29e52d3eb/href</a></iframe><ul><li>We created an Adapter class named <strong>CustomImageAdapter </strong>where we bind our ImageView by <strong>@BindingAdapter(“customImageSrc”)</strong> tag.</li><li>Once our <strong>Mutable livedata</strong> gets updated in <strong>ViewModel </strong>by success callback from <strong>Task&lt;MLImageSegmentation&gt;</strong></li><li>This imageview will automatically get updated by BindingAdapter.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b368c6d92484b1e15b52f6c36377e46/href">https://medium.com/media/2b368c6d92484b1e15b52f6c36377e46/href</a></iframe><h3>Final Result</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*y3Z8m5xIG4YywNs1SXmEjg.gif" /></figure><h3>Conclusion</h3><p>I hope you liked this article. I would love to hear your ideas on how you can use this kit in your Applications.</p><p>In case you don’t have a real device you can check out this article</p><p><a href="https://medium.com/@tusharsri/debug-your-application-on-any-hms-supported-model-no-real-device-required-408a1e134782">Debug your application on any HMS Supported Model — No Real Device Required</a></p><p>For code-labs practice visit here</p><p><a href="https://developer.huawei.com/consumer/en/community/codelabs">codelab</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b845ef38f06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debug your application on any HMS Supported Model — No Real Device Required]]></title>
            <link>https://medium.com/@tusharsri/debug-your-application-on-any-hms-supported-model-no-real-device-required-408a1e134782?source=rss-fa72077055f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/408a1e134782</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[huawei-mobile-service]]></category>
            <dc:creator><![CDATA[Tushar Srivastava]]></dc:creator>
            <pubDate>Fri, 28 Aug 2020 08:52:09 GMT</pubDate>
            <atom:updated>2020-09-15T08:23:42.560Z</atom:updated>
            <content:encoded><![CDATA[<h3>Debug your application on any HMS Supported Model — No Real Device Required</h3><h3><strong>Introduction</strong></h3><p>So you have built a wonderful application but how to test it.</p><p>Or do you want to test you application on a specific device.</p><p>Let us meet your new friendly developer tool <strong>HMS Toolkit. </strong>This tool provide us the functionality of <strong>Cloud Debugging.</strong></p><h4><strong>HMS Toolkit Installation:</strong></h4><p>If you have not yet installed HMS Toolkit then please go to below link to download the latest version of it before proceeding further into the article.</p><p><a href="https://developer.huawei.com/consumer/en/doc/development/Tools-Library/toolkit-download-0000001050148172">Document</a></p><p>Once downloading is done for the plugin you can directly install it via <strong>Install Plugin from disk</strong> option.</p><p>After installation it should show like below.</p><p>By the time of writing this article the latest version was <strong>3.0.1.300.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NJL8a9KvhTmGtyOmcqlijQ.png" /></figure><p><strong>Let’s Start with Cloud Debugging</strong></p><p>Step by step I will guide you on how you can use this tool to test and debug your application without a real Huawei Device.</p><p><strong>Step 1:</strong> Go to HMS and click Cloud Debugging as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y2xvtbR85ijCqVeg.png" /></figure><p>Cloud debugging needs a user login in order to provide access to real devices. Hence you will be redirected to a URL where you need to confirm your identity for a successful login.</p><p><strong>Step 2:</strong> Login and allow the service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/0*EsnEY-oCxF6u3W3E.png" /></figure><p>Once the service is allowed you will get a success message and your android studio will get access to real remote devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dSnq2VMJCH9OhBfy.png" /></figure><p><strong>Step 3:</strong> If this screen is not opened click on cloud debugging in right sidebar.</p><ul><li>Filters are available as highlighted below to get a specific device.</li><li>You can also check the availability of device by checking <strong>Available Devices</strong></li><li>Once the list of device is available choose any one and proceed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bft9BqJQuv9rhh9-.png" /></figure><p><strong>Step 4:</strong> Below should be the result after filter selection. Click <strong>Run</strong> and start the device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jigHVf_P01_k0zkC.png" /></figure><p>A device should appear which can be accessed by sidebar. Default testing time is 2 Hours but if your testing require more time you can choose the same device once again after it gets released automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/0*sinfQSqpUF-5ISoh.png" /></figure><p><strong>Step 5:</strong> Let us run one application to see how it is performing on Cloud Debugger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/0*AYGyaeQIG-hdAJSr.png" /></figure><p>Let us see what all configurable options are given to us with this cloud debugger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/110/0*CAnEVgm6grILP_wY.png" /></figure><p><strong>Screen Resolution:</strong></p><p>Different resolution for a device are mentioned.</p><p>My recommendation — If your internet connection is good then go for higher resolution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/122/0*EAoRamVJZtO3aqoX.png" /></figure><p><strong>Screen Size:</strong></p><p>You can also control screen size between 75%, 100% and 125%. To do that see the below screenshot.</p><p>Apart from this all three navigation buttons are provided to you for better control.</p><h3><strong>Conclusion</strong></h3><p>I hope you this article had given some insights in cloud Debugging.</p><p>In case you face any issue in the installation process do comment.</p><p><strong>PS:</strong> You can also use this while presenting your screen, it doesn’t consume resources like how android emulator would do.</p><h3><strong>References</strong></h3><p><strong>Get Application Insights and start Improving your application in minutes using HMS Toolkit Cloud Testing</strong></p><p><a href="https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0202336737782030053&amp;fid=0101188387844930001">HUAWEI Developer Forum</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=408a1e134782" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get Application Insights and start Improving your application in minutes using HMS Toolkit Cloud…]]></title>
            <link>https://medium.com/analytics-vidhya/get-application-insights-and-start-improving-your-application-in-minutes-using-hms-toolkit-cloud-512dc40fb6cb?source=rss-fa72077055f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/512dc40fb6cb</guid>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[huawei-mobile-service]]></category>
            <dc:creator><![CDATA[Tushar Srivastava]]></dc:creator>
            <pubDate>Fri, 28 Aug 2020 08:33:28 GMT</pubDate>
            <atom:updated>2020-09-04T13:37:55.235Z</atom:updated>
            <content:encoded><![CDATA[<h3>Get Application Insights and start Improving your application in minutes using HMS Toolkit Cloud Testing</h3><h3><strong>Introduction</strong></h3><ul><li>Do you want to know detailed analysis of your android application?</li><li>Do you want to improve your application performance by fixing potential errors?</li><li>Do you want to save your future time and efforts?</li></ul><p>A majority of android developers face these problems very frequently. To target this problem HMS Toolkit came up with Cloud Testing.</p><p>With Cloud Testing you can not only get deep insights of your application but you can also get application performance on multiple devices automatically.</p><p>This will save your time and resources which you can utilize in enhancing your application.</p><p>On very early stage you can identify memory leaks, storage utilization, battery utilization etc.</p><h4><strong>Let us look at Cloud Testing.</strong></h4><p>Why you need this?</p><p>Once your application is ready for production you may have to check some parameters and see how it will behave in production.</p><ul><li>Compatibility Testing</li><li>Performance Testing</li><li>Power Consumption Testing</li><li>Stability Testing</li></ul><p>Once you have analyzed and rectified Errors/Improvements in this data your application is good to deploy.</p><p>To start the process follow below steps.</p><p><strong>Step 1:</strong> Go to <strong>HMS</strong> and click <strong>Cloud Testing</strong> as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rGbAiPIlXWTTn03L.png" /></figure><p>It will open a new window in sidebar.</p><p><strong>Step 2:</strong> Choose a <strong>New Task</strong> to start the testing process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/0*kEo6hiqXbl1JIi4T.png" /></figure><p>A new window will appear which will ask you what you want to execute on your android application.</p><p><strong>Step 3:</strong> Let us choose <strong>Compatibility Test</strong> from the option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tsvM59Wmgf-70JZ6.png" /></figure><p><strong>Step 4:</strong> Click on <strong>Select Device</strong> and below window will appear.</p><p>You can select filters as well if you want to do testing on a specific device.</p><p><strong>Note:</strong> You can choose multiple device but for demonstration I will choose only one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qCbYiMFCz5mljnko.png" /></figure><p><strong>Step 5:</strong> Below screen should show once all the options are filled. Click <strong>Confirm</strong> to continue</p><p>Your apk will get uploaded for testing and once apk upload is completed you can proceed to next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lK7OMVpkU9awI3qC.png" /></figure><p>A new <strong>Compatibility Test Task</strong> will get generated and you can see it in <strong>Pending</strong> state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/0*T2H4mGKBCxyI62z6.png" /></figure><p>Soon the status color will change from Pending grey to green. This means you’re testing has started.</p><p>You can also see a new option appearing in right side of Task. This is View report. Click here and you can see the live results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*lXi7XpBUDtkoM2c_.png" /></figure><p>Below are live results of my application in progress state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XkB-P3LBjBpI0xzR.png" /></figure><p>Once the testing will finish you can see Task updated to Succeed in Android Studio.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/0*GoPO71dff9r-DNeO.png" /></figure><p>Let us again click on <strong>View Report</strong>.</p><p>Here you can see all test are in passed state and it seems my application compatibility is very stable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*foPo_ZWyRMwcto2R.png" /></figure><p>We need some real data to get the actual analysis, so let us work on a production application.</p><p>Let us check the stability + performance if we start parallel test together onto a single application.</p><p>I have started all 4 types of test to check what all info we can get regarding my application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/0*6PpFCGuZ0QGJ9bEF.png" /></figure><p>Soon the test results came and below are all the reports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/0*5k-FAz8tso8EANaU.png" /></figure><h4><strong>Stability Test</strong></h4><p>With Stability test I was able to identify below bottleneck points.</p><ul><li>Installation and Startup</li><li>Crashes</li><li>ANR</li><li>Native Crash</li><li>Leaks</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V07DiXOEbSfeeJ4K.png" /></figure><p>Further clicking on detail I could see resource utilization as well.</p><ul><li>Average CUP usage</li><li>Average Memory usage</li><li>Average battery temperature</li></ul><p>This details are available for every 2 seconds while my application was in testing mode.</p><h4><strong>Resource Tracing</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w8cI1KLROBv-O5WI.png" /></figure><p>Apart from Resource Tracing you will also get</p><ul><li>Error Codes and Descriptions</li><li>Test Screenshots</li><li>Error Information</li><li>Logcat logs</li></ul><h4><strong>Power Consumption</strong></h4><p>With Power Consumption Test I was able to identify below bottleneck points.</p><ul><li>Installation and startup</li><li>Resource Usage</li><li>Wake lock duration</li><li>Screen usage</li><li>WLAN usage</li><li>WLAN scan</li><li>Audio usage</li><li>Camera Usage</li><li>Location Sensor usage</li><li>Wake up alarms</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N7riQUMikuM7uSpr.png" /></figure><p>Further clicking on detail I could see resource utilization as well same as we got for stability test.</p><p>This details are available for every 2 seconds while my application was in testing mode.</p><h4><strong>Resource Tracing</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ouj4xZtR_SkCh08B.png" /></figure><h3><strong>Performance Testing</strong></h3><p>With Performance Test I was able to identify below bottleneck points.</p><ul><li>Installation and Start Up</li><li>Start Up Duration</li><li>Cold Start</li><li>Warm Start</li><li>UI Display</li><li>Frame rate</li><li>Memory Usage</li><li>Memory Leaks</li><li>Foreground Memory</li><li>Background Memory</li><li>Background Screen-On Memory</li><li>Background Screen-Off Memory</li><li>CPU Usage</li><li>Background Screen-On CPU</li><li>Background Screen-Off CPU</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_Rq7v8qzoDH45lr4.png" /></figure><p>Further clicking on detail I could see resource utilization as well same as we got for stability test.</p><p>This details are available for every 2 seconds while my application was in testing mode.</p><h4><strong>Resource Tracing</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hFG_680MZyc3VLh9.png" /></figure><h4><strong>Compatibility Testing</strong></h4><p>With Compatibility Test I was able to identify below bottleneck points.</p><ul><li>Initial Installation</li><li>Re-installation</li><li>Un-installation</li><li>Start up and Running</li><li>Start up</li><li>ANR</li><li>Crash</li><li>Black/White screen</li><li>Unexpected exit</li><li>Running Exit</li><li>Exit Failures</li><li>UI Errors</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f0biA62oOAQBqS7n.png" /></figure><p>Further clicking on detail I could see resource utilization as well same as we got for stability test.</p><p>This details are available for every 2 seconds while my application was in testing mode.</p><h4><strong>Resource Tracing</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pGRR2D3wbR1-pP2Y.png" /></figure><h3><strong>Testing Report</strong></h3><p>You can also download the compatibility testing report.</p><p>Below are the details of the report.</p><h4><strong>Overview Report</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TVjM9SS7Y2qz-ebm.png" /></figure><h4><strong>Performance Data Report</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yqZZTuMEUuDJcYLT.png" /></figure><h4><strong>Errors Report</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PaJjYcxfkuVYqpom.png" /></figure><h4><strong>Warnings Report</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qn9kd2GAc9BLtxN4.png" /></figure><h4><strong>Alternate access:</strong></h4><p>You can access all the above details by going to your console and clicking on testing card on home page. Here you can find all the Test task created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/0*oaM6GYJWhlzTYTdn.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ld84awhby9iGXvQY.png" /></figure><h4><strong>FAQ</strong></h4><p><strong>Not able to search Toolkit in Plugin Section.</strong></p><p>Check for HTTP Proxy Settings and set it to none.</p><p><strong>Where can I download the latest version of Toolkit plugin from?</strong></p><p><a href="https://developer.huawei.com/consumer/en/doc/development/Tools-Library/toolkit-download-0000001050148172">Document</a></p><h3><strong>Conclusion</strong></h3><p>I hope you have like this feature and I am very much sure this feature will help you in application performance improvement. In case you face any difficulty in implementing or getting the report do comment.</p><h3><strong>References</strong></h3><p><strong>Debug your application on any HMS Supported Model using HMS Toolkit Cloud Debugger — No Real Device Required</strong></p><p><a href="https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201336709130540054&amp;fid=0101188387844930001">HUAWEI Developer Forum</a></p><p><strong>HMS Toolkit — Automatic HMS SDK Integration</strong></p><p><a href="https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201249144855100206&amp;fid=0101188387844930001">HUAWEI Developer Forum</a></p><p><strong>HMS Toolkit Converter — Your New Best Friend for Migration</strong></p><p><a href="https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201222324451440007&amp;fid=0101187876626530001">HUAWEI Developer Forum</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=512dc40fb6cb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/get-application-insights-and-start-improving-your-application-in-minutes-using-hms-toolkit-cloud-512dc40fb6cb">Get Application Insights and start Improving your application in minutes using HMS Toolkit Cloud…</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Add Voice to your Android Application — Use Huawei ML Kit]]></title>
            <link>https://medium.com/huawei-developers/add-voice-to-your-android-application-use-huawei-ml-kit-8ccf2fdd59b7?source=rss-fa72077055f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ccf2fdd59b7</guid>
            <category><![CDATA[huawei-developers]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[huawei-mobile-service]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Tushar Srivastava]]></dc:creator>
            <pubDate>Thu, 13 Aug 2020 17:05:55 GMT</pubDate>
            <atom:updated>2020-08-14T07:10:08.810Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*Qn013H2jGHtdcAQ8YxG0xw.jpeg" /></figure><h3>Add Voice to your Android Application — Use Huawei ML Kit</h3><p>Text to Speech can convert text into human voice. This can be achieved by default methods also but they don’t provide natural or realistic sounds.</p><p>This service uses Deep Neural Networks in order to process the text and create a natural sound, rich timbers are also supported in order to enhance the result.</p><p>Lets understand this with some examples.</p><p>Have you ever met a situation like this before? A novel is too long to read, it will spare you much time if the app can read the novel to you. So a tool to transfer text into speech is urgently required.</p><p>This service is available globally.</p><p>As this service uses cloud service hence there is a limit of 500 characters.</p><p>These characters are encoded using UTF-8</p><p>Below are the format supported currently.</p><ul><li>English — Male voice</li><li>English — Female voice</li><li>Mandarin Chinese — Male voice</li><li>Mandarin Chinese — Female voice</li><li>English + Chinese — Male voice</li><li>English + Chinese — Female voice</li></ul><h3>Article Takeaway</h3><p>You will be able to integrate TTS service into your application</p><p>Follow the below steps to add the service into your application.</p><p><strong>Step 1:</strong> Create a new project in Android Studio</p><p><strong>Step 2:</strong> Add the below dependencies into app.gradle file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b9a195756b60245df39bccf64f7cfb8/href">https://medium.com/media/1b9a195756b60245df39bccf64f7cfb8/href</a></iframe><p><strong>Step 3:</strong> Add agc plugin in the top of app.gradle file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/65c54281b59c249141119082ec421167/href">https://medium.com/media/65c54281b59c249141119082ec421167/href</a></iframe><p><strong>Step 4:</strong> Create a callback in your activity</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/91eb54af8f381b8ec35804970ba271d3/href">https://medium.com/media/91eb54af8f381b8ec35804970ba271d3/href</a></iframe><h3>Let us discus this in detail.</h3><h3>4 callback methods are provided. Below are the details.</h3><ul><li><strong>OnError()</strong> — In case of any error the control will flow here, you can use this to notify user what error occurred and send the analytics data by <strong>HMS Analytics</strong> to console for further verification.</li><li><strong>OnWarn()</strong> — In case of warning like insufficient bandwidth the callback comes here.</li><li><strong>OnRangeStart()</strong> — It return the mapping between the currently played segment and text</li><li><strong>OnEvent()</strong> — Whenever a new event occur this method is called, example — In case of audio paused we will get <strong>EVENT_PLAY_STOP_INTERRUPTED</strong> parameter in bundle.</li></ul><p>o If <strong>MLTtsConstants.EVENT_PLAY_STOP</strong> is false then whole audio is played without issue.</p><p>o If <strong>MLTtsConstants.EVENT_PLAY_STOP</strong> is true then there is some interruption.</p><p><strong>Step 5:</strong> Object Initialization</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4d45a81a52078cfb9fc5acffb06fa0c5/href">https://medium.com/media/4d45a81a52078cfb9fc5acffb06fa0c5/href</a></iframe><h3>Let us discus this in detail.</h3><h3>There are 2 ways by which we can create TTS Engine.</h3><p>We will be using custom <strong>TTSEnigne</strong> by <strong>MLTtsConfig</strong> object.</p><ul><li>Language set to English by <strong>MLTtsConstants.TTS_EN_US</strong></li><li>You can set language by <strong>MLTtsConstants.TTS_ZH_HANS</strong> for Chinese.</li><li>Set person voice by <strong>MLTtsConstants.TTS_SPEAKER_FEMALE_EN</strong></li><li>English Male — <strong>MLTtsConstants .TTS_SPEAKER_MALE_EN</strong></li><li>Chinese Female — <strong>MLTtsConstants .TTS_SPEAKER_FEMALE_ZH</strong></li><li>Chinese Male — <strong>MLTtsConstants .TTS_SPEAKER_MALE_ZH</strong></li><li>Set the speech speed. Range: 0.2–1.8. 1.0 indicates 1x speed.</li><li>Set the volume. Range: 0.2–1.8. 1.0 indicates 1x volume.</li><li>Create the object of <strong>MLTtsEngine </strong>and provide above <strong>MLTtsConfig</strong> object.</li><li>Set the above created <strong>callback</strong> object into <strong>MLTtsEngine</strong></li></ul><p><strong>Step 6:</strong> Add the below method in your activity and call it on click of a button</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e2708dbf5e6fe2421e777582a13e098b/href">https://medium.com/media/e2708dbf5e6fe2421e777582a13e098b/href</a></iframe><h3>Let us discus this in detail.</h3><ul><li><strong>sourceText </strong>is the text entered by user.</li><li><strong>MLTtsEngine.QUEUE_APPENDED</strong> is used when we want queue system. Once first operation of TTS will complete then next will start.</li><li>In case you want a functionality where you want to only process current operation then use <strong>MLTtsEngine. QUEUE_FLUSH</strong></li><li>In <strong>onPause()</strong> you can stop the <strong>MLTtsEngine</strong> by</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b36b635d3bc00ee7e7957e3925d5f4a3/href">https://medium.com/media/b36b635d3bc00ee7e7957e3925d5f4a3/href</a></iframe><ul><li>In <strong>onDestroy()</strong> you can release the resources occupied by <strong>MLTtsEngine</strong>.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0fd1886995e5b6228113dd377b362c21/href">https://medium.com/media/0fd1886995e5b6228113dd377b362c21/href</a></iframe><p><strong>FAQ</strong></p><p><strong>Is TTS only available on Huawei devices?</strong></p><p>Yes</p><p><strong>Do you need internet access in order to use TTS service?</strong></p><p>Yes, this is a cloud based service hence internet is required.</p><h3>Conclusion</h3><p>We have merely scratched the surface. The text-to-speech function provided by HUAWEI ML Kit is also applicable to the following scenarios: News reading, audio novels, stock information broadcast, voice navigation, and video dubbing.</p><p>Above are some areas which needs TTS as a main service.</p><p>Below is the github link where you can download the source code.</p><p><a href="https://github.com/HMS-Core/hms-ml-demo/tree/master/TTSSampleKotlin"><strong>Github Link</strong></a></p><p><strong>Read my other articles on ML Kit</strong></p><p><a href="https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201229683997600043&amp;fid=0101187876626530001"><strong>Image Segmentation</strong></a></p><p><a href="https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201230472937060047&amp;fid=0101187876626530001"><strong>Text Translation</strong></a></p><p><a href="https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201236478929600089&amp;fid=0101187876626530001"><strong>Text Recognition</strong></a></p><p><a href="https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201261566832050274&amp;fid=0101187876626530001"><strong>Bank Card Recognition</strong></a></p><p><a href="https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201264568431750009&amp;fid=0101187876626530001"><strong>Automatic Speech Recognition</strong></a></p><p>I hope you liked this article. I would love to hear your ideas on how you can use this kit in your Applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ccf2fdd59b7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/huawei-developers/add-voice-to-your-android-application-use-huawei-ml-kit-8ccf2fdd59b7">Add Voice to your Android Application — Use Huawei ML Kit</a> was originally published in <a href="https://medium.com/huawei-developers">Huawei Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[India’s first Facebook Developer Circles Lead Summit.]]></title>
            <link>https://medium.com/@tusharsri/indias-first-facebook-developer-circles-lead-summit-78b6eae7d384?source=rss-fa72077055f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/78b6eae7d384</guid>
            <category><![CDATA[facebook]]></category>
            <category><![CDATA[lead-summit-india]]></category>
            <category><![CDATA[leaders]]></category>
            <category><![CDATA[facebook-developer-circle]]></category>
            <category><![CDATA[facebook-event]]></category>
            <dc:creator><![CDATA[Tushar Srivastava]]></dc:creator>
            <pubDate>Wed, 08 Jan 2020 18:27:51 GMT</pubDate>
            <atom:updated>2020-01-10T16:27:14.321Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iJY1WSbJwAIOwoehUJtVQg.jpeg" /></figure><p>Recently there has been India&#39;s first Facebook developer Circle- Lead Summit which was hosted in Gurugram.<br>Fortunately I was a part of this Summit as co-lead of Facebook Developer Circles Chandigarh and I would like to share my experience and my take away from the Summit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*1hv2QXN32rtIXlnRIjrMeA.gif" /></figure><p>I would like to divide this article into three sections and will make sure to provide the same experience I received.</p><p>If you walk into a community you must have gone through a phase where you feel demotivated or vision-less. <br>This Summit not only helped me resolve my misery but also gave me the missing part of the puzzle where now I can clearly see my vision for 2020 as a community leader and how my community will impact the society.</p><h3>Day 1: One Team</h3><p>Even before day 1 started I had received a lot of mails for coordination reservation and get together. They even told us the outdoor temperature so that we can enjoy the sessions comfortably.</p><p>We reached the resort by 12:00 and were welcomed by the hotel staff with a saffron Tilaka. It gave me a feeling of homecoming.<br>Facebook team had arranged our separate reception and hence our check-in was in a snap. We left all our bags there and went to the Ballroom where Summit was going to happen. We started with an ice breaker Bingo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*nMVgyFpAdlcJvRSrVoqi2g.gif" /></figure><p>The entry itself was decorated and hence I started with my photography. Breakfast was available whole time in case we felt like having it, we can just grab a bunch of items including tea.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CejG2TrrVxF9tdn4KIcO8A.jpeg" /></figure><p>While munching everyone was greeting each other and asking about their circles and how things are going on. They all seemed to be quite friendly and invited me to join.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*ORyVyBuoRAuBn2b-oFV8Gw.gif" /></figure><p>Mr. Satyajeet and Mr. Ojasvi came after managing everything inside which made sense as in our session as a host we are always running to make things perfect.<br>They both introduced us to the whole Facebook Team</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z07N1Umz-NAvtJBnuspieA.jpeg" /></figure><p>The lunch was ready and when almost everyone arrived we were requested to start having lunch.<br>Below are some sweet dish for you too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WqeQ6D9UlBfb95G7RKgqdQ.jpeg" /></figure><h4>Surprise Surprise</h4><p>Lunch was over just a minute ago and we were presented with hoodies to wear. Guess what was written behind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6sRAPA5DYA87QX1KUPTvSw.jpeg" /></figure><p>And yes a badge with name engraved on it was a cherry on the cake.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FGzlgQHpAcSg87AFgKWmxA.jpeg" /></figure><p>I was already on seventh heaven. Then we entered into our session hall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IFx6Vfv5X_m60wKPNZDbhw.jpeg" /></figure><p>Firstly we were welcome by Mr. Satyajeet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hF5jQ1j-BgRoZIaMLMWzyw.jpeg" /></figure><p>After him came our host Mr. Ojasvi.</p><p>Then we were welcomed by all the Developer Circle managers from around the world through video messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ixjPbhUzm4Y26gJ75H2Cg.jpeg" /></figure><p>And last but not the least we were welcomed by Mr. Aaron.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5mNhj3dOypgwg1sfEqPcKg.jpeg" /></figure><p>They all started with how we began as a small community and now how things are building up and how we all are contributing towards a bigger picture. To make a vision come true. To make a better society we live in.</p><p>Yes this took a lot of time in explanation of all the achievements our community had which I just concluded in 3 lines.</p><p>Soon after this we got a break to have some snack and refreshments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QtnFd8ZwIOldkCfUbvb1gg.jpeg" /></figure><p>Second session was a team building activity named “Beat The Box”.</p><p>5 boxes were given which were one inside another. All of them were locked with a different lock. The team who opens all the boxes first will win the competition. Total time was given to us was 1.5 hour.</p><p>I knew how to pic locks, all the 5 boxes took me 1 hour to open. In the last box we got 1 big cardboard with “E” written.</p><p>We screamed that we won but we were clueless of why they are not declaring us winner. The timer never stopped ticking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IzmAGoGjj417hottq1bAYw.jpeg" /></figure><p>Other teams also opened their boxes within time and then they also got letters, after opening last box when we combined all the cards it came out to be “1 TEAM”. The purpose was to play together, to think together and make a bond among us. They were able to inject the feelings of togetherness successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*OPXqHnLGa4PsHIKCS3qX8w.gif" /></figure><p>We all were winner. As we were 1 team. Chocolates were distributed and we went to our room as party was about to start in 30 minutes.</p><h3>Night 1: The Party</h3><p>We returned by 8 and what i saw was bonfire, barbecue and DJ.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gx9euiiCFYut506_t_iPEQ.gif" /></figure><p>The party was speechless. I just met everyone in morning and now we all were dancing together.</p><h3>Day 2: The Goodbye</h3><h4>Morning Surprise</h4><p>Although I was not able to sleep properly due to excitement and anxiety but still I woke up early and waited for the supplies in morning. Exactly at 7:00 a.m. somebody knocked my door and I got a beautiful surprise from Facebook below is the photograph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6fXet9Mul_kLrFq-m9_J7Q.jpeg" /></figure><h4>Breakfast</h4><p>Before going through the session I went for breakfast.<br>There I met my yesterday friends. We were sitting on the top of a hill where live breakfast was being served. Soon Mr. Ojasvi joined us as well. After breakfast we went for the sessions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rHCpLK0nVz0SiVVBBmXGcw.jpeg" /></figure><h4>Final Presentation.</h4><p>Every lead has to prepare a presentation where he could show how his circle benefited the society.<br>I started my presentation with my story implying how important lead calls were.</p><p>It was this call which gave me an impression of building the A-TEAM. Our major finding from last year’s events was “lack of information” in society rather than “lack of education”. We need more COLLABORATION with different Colleges and communities to make a greater impact on the society.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*a6jhR8vBZwz5bB-QjODzEg.gif" /></figure><h4>The Gifts</h4><p>And here comes the exciting part we been called on stage to get especially packed gift from Facebook and precious one handwritten note from Facebook team.<br>Getting such respect especially from Facebook team really influenced me inside out. Earning their respect is truly a dream come true. We all are working toward the same vision and will try to make sure to achieve some more milestones this year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kVbPgd3dAnnGkxmQZ-3Vcw.jpeg" /></figure><h4>Award Ceremony</h4><p><a href="https://www.facebook.com/groups/DevCDelhiNCR/"><strong>Most Inspiring Developer Circle </strong>— Delhi</a></p><p><a href="https://www.facebook.com/groups/DevCMumbai/"><strong>Most Innovative Developer Circle</strong> — Mumbai</a></p><p><a href="https://www.facebook.com/groups/DevCIndore/"><strong>Best Performing Developer Circle</strong> — Indore</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7CyJTBYPRrZTh40akeImPQ.gif" /></figure><p><a href="https://www.facebook.com/sabyasachi.mukhopadhyay.9"><strong>Most Inspiring Developer Circle Lead</strong> — Sabyasachi Mukhopadhyay</a></p><p><a href="https://www.facebook.com/purohit.ashwini"><strong>Best Supporting Developer Circle Lead</strong> — Ashwini Purohit</a></p><p><a href="https://www.facebook.com/sangeeta.gupta.90"><strong>Newest Squad on the block</strong> —Sangeeta Gupta</a></p><h4>Cake Cutting</h4><p>It was time to say goodbye but before that our last celebration was cake cutting ceremony.<br>With the beautiful song and guitar we cut the cake.<br>Then we all joined together for the photograph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*achYJPHh3Pj3cFIPyRSvPw.jpeg" /></figure><h4>Goodbye Note</h4><p>Bags were already kept in Our Cabs who were waiting outside the hotel.<br>Meeting people with the same vision motivates you to become a better version of yourself or inspires you to improve every day.</p><h3>My Takeaway:</h3><p>So here comes to conclusion my take away from the event.<br>It is already hidden above. <br>I have tried my best to showcase those key values in a very subtle way.<br>Last but not the least I would like to thank the whole Facebook team for this collaboration and all my fellow leads who are continuously teaching me directly or indirectly every moment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Mv4_wcMOdncUQm2piTmtA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78b6eae7d384" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Face Detection using Haar Cascade Classifier]]></title>
            <link>https://medium.com/@tusharsri/face-detection-using-haar-cascade-classifier-72f207b1cf47?source=rss-fa72077055f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/72f207b1cf47</guid>
            <category><![CDATA[eye-detection]]></category>
            <category><![CDATA[haar-cascades]]></category>
            <category><![CDATA[facedetection]]></category>
            <category><![CDATA[smile-detection]]></category>
            <category><![CDATA[body-detection]]></category>
            <dc:creator><![CDATA[Tushar Srivastava]]></dc:creator>
            <pubDate>Sun, 25 Aug 2019 11:39:01 GMT</pubDate>
            <atom:updated>2019-08-25T11:50:10.611Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*27zZzd5CwcAtGWH7LbBMdg.jpeg" /></figure><p>If you are starting your journey into AI, I would say this is a must try/Simplest example which can make your future journey into the world of AI interesting.</p><p><strong>Our final goal for this article is to detect a weather a face is present in a picture and if present then mark it into a rectangle box, On top of that we will try to detect a face from video and webcam too. Lots of interesting stuff to come so lets get started.</strong></p><p>First things first, before jumping into the practical lets get some basic knowledge of what Haar Cascade is???</p><p>This is a type of classifier. A classifier is what predict to which set a new entry belongs to.</p><p>Lets discus an example, I will give you 2 categories Bollywood and Hollywood. Now You will be given 5 movie names and you have to identify weather they belongs to Bollywood or Hollywood. Easy right, movie names are “Avengers”, “Superman”, “Dangal”, “ <em>3 Idiots</em>”, “Titanic”. If you have added “Dangal” and “3 Idiots” into Bollywood list and rest in Hollywood list then congratz you have successfully converted your brain into a classifier.</p><p>In the same way Haar Cascade is a classifier. It is been trained with lots of face images. After that successful and intense training Haar Cascade classifier is now used to detect faces from an Image or video.</p><p>There are lot of predefined Haar Cascade available on <a href="https://github.com/opencv/opencv/tree/master/data/haarcascades">Github</a>. The file which we are interested in will be <a href="https://github.com/TusharSri/MachineLearning/blob/master/Face%20Detection%20using%20Haar%20Cascade/Face%20Detection%20using%20Haar%20Cascade%20Classifier.ipynb">“haarcascade_frontalface_default.xm</a>l”.</p><p>In this file all the trained values are available which can help us identify a face.</p><p>Now open Jupyter Notebbook and create a new python notebook with name as Face Detection. Note down the dirctory where this file is being creatad.</p><p>Download the “haarcascade_frontalface_default.xml” and save it to this directory.</p><p>Choose an image of your choice and download it to this same directory, all setup complete.</p><h3>Part 1: Detect face in an image</h3><p>Copy and paste the below code in notebook.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47ef1ddf96fb050775353d1729903821/href">https://medium.com/media/47ef1ddf96fb050775353d1729903821/href</a></iframe><pre>Go to line 4 where below code is written.<br>cv2.imread(‘im.JPG’)</pre><p>Change the image of your choice(Which you have saved earlier into the directory) including its extension, like in our case we were having “.JPG”.</p><p>Below is the output which i got.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*KpBXdYa502Juq_zi6n7vdA.jpeg" /></figure><p>See how easily this classifier identifies face by just looking onto the image.</p><h3>Part 2 : Detecting face in video.</h3><p>Any video is just a series of images, So in order to detect tect face from video we need to loop the above code and rest everything will e a piece of cake.</p><p>Choose any video of your choice(mine was a song :P) and copy it to the same directory where your Jupyter Notebook and Haar Cascade files are residing.</p><p>Copy past the below code into Jupyter Notebook.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8f5ec98055ab6446288587869b2c39be/href">https://medium.com/media/8f5ec98055ab6446288587869b2c39be/href</a></iframe><p>Below is my output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*hopOgHIp1VRkcXNY1gAukg.gif" /></figure><p>Cool right. now lets move to part 3.</p><h3>Part 3: Detecting face from WebCam</h3><p>Copy paste below code in Jupyter Noteook and see the magic.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/394f89a3bcf6315c2d4539e8348344c0/href">https://medium.com/media/394f89a3bcf6315c2d4539e8348344c0/href</a></iframe><p>I hope you are now successfully able to detect face from any kind of source.</p><p>You can do a lot of experiment with Haar Cascade Classifiers for example.</p><ul><li><strong>Detecting Eye</strong></li><li><strong>Detecting Smile</strong></li><li><strong>Detecting Body</strong></li></ul><p>For all the above examples just replace the Haar Cascade of your choice in the code and save that file to your main directory.</p><p>In case you find this article helpful then do clap and share with other.</p><p>Also do let me know if you want to learn how to create your own Haar Cascade classifier or want to understand its working. Cheers !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72f207b1cf47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lemmatization]]></title>
            <link>https://medium.com/@tusharsri/lemmatization-af85aa3e5a86?source=rss-fa72077055f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/af85aa3e5a86</guid>
            <category><![CDATA[spacy]]></category>
            <category><![CDATA[wordnet]]></category>
            <category><![CDATA[nltk]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[lemmatization]]></category>
            <dc:creator><![CDATA[Tushar Srivastava]]></dc:creator>
            <pubDate>Mon, 19 Aug 2019 17:54:10 GMT</pubDate>
            <atom:updated>2019-08-19T18:36:15.254Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*bidcqbNqm2WDFG3KmmY0Yg.jpeg" /></figure><p><a href="https://en.wikipedia.org/wiki/Lemmatisation">Lemmatisation </a>in linguistics is the process of grouping together the inflected forms of a word so they can be analysed as a single item, identified by the word’s lemma, or dictionary form</p><p>for example, run, runs, ran and running are forms of the same set of words that are related through inflection, with run as the lemma.</p><p>In case you are looking for source code please visit my <a href="https://github.com/TusharSri/MachineLearning/blob/master/NLP%20-%20Lemmatization.ipynb">Github Repo</a> where you can find other cool stuff too.</p><p><strong>What is the different between Stemming and Lemmatization??</strong></p><p>Unlike <strong>Stemming</strong>, <strong>Lemmatisation </strong>depends on correctly identifying the intended part of speech and meaning of a word in a sentence, as well as within the larger context surrounding that sentence, such as neighboring sentences or even an entire document</p><h3>Why should we need Lemmatization when we have Stemming??</h3><p>The purpose of both stemming and lemmatization is to reduce morphological variation or to reduce inflectional forms and sometimes derivationally related forms of a word to a common base form.</p><p>A Stemmer will return the stem of a word, which needn&#39;t be identical to the morphological root of the word. It usually sufficient that related words map to the same stem,even if the stem is not in itself a valid root, while in lemmatisation, it will return the dictionary form of a word, which must be a valid word.</p><p>In lemmatisation, the part of speech of a word should be first determined and the normalisation rules will be different for different part of speech, while the stemmer operates on a single word without knowledge of the context, and therefore cannot discriminate between words which have different meanings depending on part of speech.</p><p>How can we implement Lemmatization.</p><p>We will be implementing lemmatization with Wordnet and Spacy library.</p><p><strong>Let’s first discus what is Wordnet ?</strong> <br><a href="https://en.wikipedia.org/wiki/WordNet"><strong>WordNet </strong></a>is a large lexical database of English. Nouns, verbs, adjectives and adverbs are grouped into sets of cognitive synonyms (synsets), each expressing a distinct concept. Synsets are interlinked by means of conceptual-semantic and lexical relations. <br>If you want to play around with Lemmatization and Wordnet <a href="http://wordnetweb.princeton.edu/perl/webwn">check this website</a>.</p><p>Now lets start implementing it into code and see the magic.</p><p>Copy paste below code into Jupyter Notebook.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/93b43870da9fb8c44c7a0cfcee464120/href">https://medium.com/media/93b43870da9fb8c44c7a0cfcee464120/href</a></iframe><p>If the below code gives you error of “Module not found” or if you haven’t used Wordnet before run below code as well. This will download the library.</p><pre><strong>import nltk<br>nltk.download(‘wordnet’)</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*KQlYCEXMbvc8GrKKn01CBw.png" /></figure><p>Points to ponder.</p><ul><li>run and runs came into same root word but ran and running did’nt.</li><li>go, went gone going were from same root word but unfortunately they were not lemmatize to root word.</li><li>colors converted to color</li></ul><p>From the above example we can see WordNet had done a great job in removing suffix and lemmatizing the whole sentence.</p><p>There were some flaws we have observed in the above example as well.</p><p>What if we can overcome all these flaws. To make this come true came <a href="https://spacy.io/">Spacy </a>library. Its designed keeping requirements of a developer in mind.</p><p>Let us use the same sentence and lemmatize it using Spacy.</p><p>Copy paste below code in Jupyter Notebook.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/08847948690879b2cdb38aeb399547f1/href">https://medium.com/media/08847948690879b2cdb38aeb399547f1/href</a></iframe><p>If you ran into a problem of spacy installation, <a href="https://medium.com/@tusharsri/remove-add-stop-words-7e2994c19c67">Use this post for installation.</a></p><p>Below is the output of the following code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*82t23rxSURGpJcKcPfcovQ.png" /></figure><p>Voila! all problems solved in a single go.</p><p>Noticed how we are getting root words from different forms of words.</p><p>It is also removing suffix like we were getting from wordnet.</p><p>According to my opinion I found Spacy working better than WordNet but this totally depends upon Dataset we are using.</p><p>In case you found any issues with the article do let me know.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af85aa3e5a86" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>