<?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 Suyog Jadhav on Medium]]></title>
        <description><![CDATA[Stories by Suyog Jadhav on Medium]]></description>
        <link>https://medium.com/@IAmSuyogJadhav?source=rss-20ef1e3529ba------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xloVIjEarIFnoLiG6ET2fw.jpeg</url>
            <title>Stories by Suyog Jadhav on Medium</title>
            <link>https://medium.com/@IAmSuyogJadhav?source=rss-20ef1e3529ba------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 09:44:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@IAmSuyogJadhav/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[Using ANTs package on Google Colaboratory]]></title>
            <link>https://medium.com/@IAmSuyogJadhav/using-ants-package-on-google-colaboratory-e11376f277f?source=rss-20ef1e3529ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/e11376f277f</guid>
            <category><![CDATA[ants]]></category>
            <category><![CDATA[google-colaboratory]]></category>
            <category><![CDATA[advanced-normalization]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[biomedical-imaging]]></category>
            <dc:creator><![CDATA[Suyog Jadhav]]></dc:creator>
            <pubDate>Thu, 28 Mar 2019 00:00:00 GMT</pubDate>
            <atom:updated>2019-04-07T07:58:04.469Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*f3c3AQ7ydOPDKliGuZ-zmA.png" /></figure><h3>A Primer on ANTs and Google Colaboratory</h3><p><a href="http://stnava.github.io/ANTs/"><strong>Advanced Normalization Tools</strong></a> (or simply, <em>ANTs</em>) is one of the few packages available in the domain of brain MRI study. It is <em>the</em> state-of-the-art package currently available for various tasks related to brain MRI scans like registration, normalization and bias field correction (including both N3 and N4 bias field correction). Though the package hasn’t been updated with a major release in a while, it works pretty well on PCs.</p><p><a href="https://colab.research.google.com/"><strong>Google Colaboratory</strong></a> (or simply, <em>Colab</em>) has quickly risen to become one of the most commonly used platforms by machine learning researchers and students all over the globe. Through Colab, Google provides users free access to cloud resources for machine learning. With a Google account, you get access to a Google’s version of IPython Notebook backed by either CPU, GPU, or even TPU runtime (you get to choose).</p><p>I am currently working on a project dubbed <a href="https://github.com/IAmSuyogJadhav/Brainy"><em>Brainy</em></a> which is based on brain tumor segmentation from MRI scans of the patient’s brain. At the time of writing this article, I couldn’t get ANTs to install on the Colab environment. There are not many helpful articles on the internet, and the existing pre-built binaries were too outdated. After some iterations, I was able to build ANTs from the source on Colab itself. The binaries included in the next section were built specifically for Colab and should work fine on Colab. However, if you run into an error, do let me know by raising an issue <a href="https://github.com/IAmSuyogJadhav/Brainy/issues/new">here</a>.</p><h3>Pre-Built Binaries</h3><p>I will try to keep this section updated by posting a new binary based on the latest master branch of <a href="https://github.com/ANTsX/ANTs">ANTsX/ANTs</a> after a major release.</p><ul><li><a href="https://drive.google.com/file/d/1N1Qx-R5tLCX5EhXPoPdyg6YvEkDtf-cD/view?usp=sharing">ANTs-28–03–2019</a></li></ul><h3>Installation Instructions</h3><ol><li>Open the latest build from above links. It is a Google Drive link. Add the .7z file to your drive by clicking the <em>Add to Drive</em> icon.</li><li>Open a new Colab notebook.</li><li>Mount the drive by running the following cell:</li></ol><pre>from google.colab import drive <br>drive.mount(&#39;/gdrive&#39;) </pre><p>4. Drive is now mounted at /gdrive. Copy the archive from your drive using cp and extract it using 7z.</p><pre>!cp &#39;/gdrive/My Drive/ANTs-28–03–2019.7z&#39; ./<br>!7z x ANTs-28–03–2019.7z</pre><p>5. Now copy the entire contents of the newly created bin folder to /usr/local/bin/:</p><pre>!cp bin/* /usr/local/bin</pre><p>6. Test the installation by running:</p><pre>!which antsRegistration</pre><p>it should output full path to antsRegistration (which should be /usr/local/bin/antsRegistration in our case)</p><p>That’s it! If you face any errors, <a href="https://github.com/IAmSuyogJadhav/Brainy/issues/new">please let me know</a>.</p><h3>Building on your own</h3><p>If you are curious to know the steps to build ANTs on Colab, view the notebook used to build the above binaries <a href="https://colab.research.google.com/drive/1mCRy-A4qve8QaYmYRWjKR2MyycrloDEt#scrollTo=kZA_FAp1BOM-">here</a>. Keep in mind that it takes a LOT of time to compile. If you build a more recent version than available above, hit me up and I will add it above.</p><p><em>Originally published at </em><a href="https://www.suyogjadhav.com/misc/2019/03/28/Using-ANTs-package-on-Google-Colaboratory/"><em>suyogjadhav.com</em></a><em> on March 28, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e11376f277f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FaceSearch]]></title>
            <link>https://medium.com/@IAmSuyogJadhav/facesearch-eef09f6506a0?source=rss-20ef1e3529ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/eef09f6506a0</guid>
            <category><![CDATA[iamsuyogjadhav]]></category>
            <category><![CDATA[face-search]]></category>
            <category><![CDATA[opencv]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Suyog Jadhav]]></dc:creator>
            <pubDate>Tue, 10 Jul 2018 00:00:00 GMT</pubDate>
            <atom:updated>2019-03-22T07:13:01.528Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*yXAo2V60sC6KGZI7Lm0tSg.png" /></figure><p>FaceSearch searches for faces in a given image using OpenCV and then googles them using <em>Google Reverse Image Search engine</em>. Read on to see how this simple application can be easily built using OpenCV.</p><figure><a href="https://github/com/IAmSuyogJadhav/FaceSearch"><img alt="" src="https://cdn-images-1.medium.com/max/231/1*Eq-XOK4ULlF6pe0yH_cXPw.png" /></a></figure><h3>Motivation</h3><p>This occurred to me while scrolling through my news feed that there were a lot of unknown people in many of the photos. Some of the photos also included a few people I already knew and followed posing with those ‘strangers’. Happens quite often with most of us. Most of the times, we simply ignore or try to google (and retreat). We don’t really have any idea what to do in such a scenario! After 10–15 minutes of Google searching and/or Google <em>dorking</em>, we sometimes even achieve our goal; but nonetheless, not in a very straightforward way. I had learned OpenCV recently and having mostly gone through a lot of MOOCs in the summer (doing nothing but learning stuff), I thought why not give it a try!</p><h3>The way to go</h3><p>The Google reverse image search comes in handy when you can’t tell Google what you want, in words. The case is similar here. We know the face, not the name. We can use it. However, just running an image search for the entire image wouldn’t be much fruitful, as it would most likely return you the same source from where you got the image!</p><p>We can, however, fine-tune the task and force it to search for a particular face in the image by using OpenCV and its Cascade Classifier. Searching for only the face turned out to be giving better results. We also need to upload the cropped image automatically to Google and open a new browser window with the results. A little bit of research showed it to be possible without any API, since Google has a static link to which one can simply send a POST request (using requests in python) to upload an image. The returned response contains a header named ‘Location’ which is the URL of search results found by Google. We can then use Python&#39;s built-in webbrowser module to open the URL in the user’s browser. That’s all we’ll need.</p><h3>Implementation</h3><p>The script is a command line application. Once installed, you just have to do facesearch path/to/image to run the script on an image. OpenCV is an open-source computer vision library originally written in C++. It is widely used for computer vision related tasks. For the curious, computer vision is the field of AI that deals with making the computers ‘see’, i.e., work with images and derive useful data from it. OpenCV was used to detect the faces in the given image, which were then cropped out using Numpy, a python library for performing advanced mathematical stuff in python. Mostly used for working with matrices. The cropped faces are then padded appropriately and shown to the user in a window, using OpenCV. OpenCV provides a dedicated function (cv2.setMouseCallback) to track the Mouse events on a window. It returns us the event name and the (x, y) coordinates of the event. Using the x, y coordinates of the click event, we can figure out which face user has clicked on. This allows for convenient point-and-click operation. For the convenience of dragging any image right off the internet and onto the terminal to get it searched, the script checks if the path provided to it is an internet URL and if it is, uses urllib to GET the image for further operations.</p><p>At last, to search for the selected face, the cropped out face is saved temporarily in the current directory and then uploaded to Google’s server using the static link. Once the image is uploaded and the response is received back, the location header is read and passed to the webbrowser module, which then opens a new browser window or a new tab in an existing session with the search results. The script then cleans up the generated image and exits.</p><h3>Installation</h3><ul><li>Directly download the latest release from the <a href="https://github.com/IAmSuyogJadhav/FaceSearch/releases">releases</a> page.</li></ul><p><strong>OR</strong></p><ul><li>First clone this repo.</li></ul><pre>git clone <a href="https://github.com/IAmSuyogJadhav/FaceSearch.git">https://github.com/IAmSuyogJadhav/FaceSearch.git</a></pre><ul><li>Change to the newly created directory FaceSearch/.</li><li>Now, to install the dependencies and create the alias for FaceSearch (to use the facesearch command), run the install.sh script.</li></ul><pre>bash install.sh</pre><h3>Usage</h3><p>Once it finishes, you can now use the following command on the terminal to detect and search for the faces in any image.</p><pre>facesearch path/to/Image</pre><p><strong>Also</strong>, note that the path/to/Image can be an internet URL as well! (prefixed with http: or https:) So, you can just drag an image off the internet over the terminal to get its URL pasted over there and search for faces in it using FaceSearch. Really convenient.</p><h3>Examples</h3><p>Test image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/0*x_ZyfBY3z18rro9R.jpg" /></figure><p>On command line:</p><pre>anon@anon-pc:~/FaceSearch$ facesearch example/test.jpg<br>[ INFO:0] Initialize OpenCL runtime...<br>Uploading image..<br>Thanks for using this tool! Please report any issues to github. https://github.com/IAmSuyogJadhav/FaceSearch/issues <br>Created new window in existing browser session. <br><a href="https://www.suyogjadhav.com/cdn-cgi/l/email-protection">a</a>non@anon-pc:~/FaceSearch$ █</pre><p>Output Window:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/0*iabANo9oRFuUH3qd.png" /></figure><p>In the browser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mmvTGflFDF4QMoHj.png" /></figure><p>Any feedback, bug reports, and issues are welcome <a href="https://github.com/IAmSuyogJadhav/FaceSearch/issues/new">here</a>!</p><h3>Updates</h3><ul><li>18–10–18: Created and released the first release of FaceSearch (v1.0). Directly downloadable from <a href="https://github.com/IAmSuyogJadhav/FaceSearch/releases">here</a>.</li><li>12–10–18: Thanks to Kaj Jansen, fixed an easy-to-miss bug. The script previously used the default system python; but, this caused an issue because of the list.copy() method not being defined in Python 2. Changed the script to explicitly use Python 3 now. Also, added a function in install.sh to remove any redundant aliases defined by the same name, to prevent problems occurring because of running install.sh script multiple times.</li><li>10–08–18: Added support for closing the output window by GUI [x] button.</li><li>07–08–18: The project report is now ready! You can read it <a href="https://www.suyogjadhav.com/files/facesearch/Project_Report.pdf">here</a>.</li><li>05–08–18: A blog post detailing the implementation and working of FaceSearch is live now. Read it <a href="https://mlendeavours.wordpress.com/2018/08/05/facesearch/">here</a>.</li></ul><p>Image Source: <a href="http://im.rediff.com/getahead/2018/feb/26tanmay1.jpg">Rediff</a></p><blockquote><em>Originally published at </em><a href="https://www.suyogjadhav.com/projects/2018/07/10/FaceSearch/"><em>suyogjadhav.com</em></a><em> on July 10, 2018.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eef09f6506a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>