<?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 Ayushi Tiwari on Medium]]></title>
        <description><![CDATA[Stories by Ayushi Tiwari on Medium]]></description>
        <link>https://medium.com/@ayushitiwari2103?source=rss-ab7b971bd6ce------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RsL5X82BvAclcoUzMAENIA.jpeg</url>
            <title>Stories by Ayushi Tiwari on Medium</title>
            <link>https://medium.com/@ayushitiwari2103?source=rss-ab7b971bd6ce------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 23:15:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ayushitiwari2103/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[GSoC’ 20: Swift Image Loader for Swift for Tensorflow]]></title>
            <link>https://medium.com/@ayushitiwari2103/gsoc-20-swift-image-loader-for-swift-for-tensorflow-56b4195c50b?source=rss-ab7b971bd6ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/56b4195c50b</guid>
            <category><![CDATA[image-loading]]></category>
            <category><![CDATA[gsoc-2020]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[jpeg]]></category>
            <category><![CDATA[benchmarking]]></category>
            <dc:creator><![CDATA[Ayushi Tiwari]]></dc:creator>
            <pubDate>Mon, 31 Aug 2020 15:54:17 GMT</pubDate>
            <atom:updated>2020-08-31T23:36:05.976Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>GSoC’ 20: Swift Image Loader for Swift for TensorFlow</strong></h3><h3><strong>Introduction</strong></h3><p>I have been working on fast Image Loading in Swift which is necessary for training image based machine learning models. We decided to use pre-build libraries and choose the fastest and the most stable one, so, I used JPEGturbo and created a package using CMake for the model to work seamlessly across all the platforms. It’s working for JPEG images as of now. I am planning to add PNG support in the future.</p><h3>Accomplishments</h3><h4>Milestone 1</h4><p>In my first milestone I found out which library I was going to use for my image loader.</p><ol><li><strong>Created a testing dataset.</strong></li></ol><p>For the dataset, we used:</p><p><a href="https://github.com/fastai/imagenette">fastai/imagenette</a></p><p>Its dataset with 10 classes and almost 13000 images and its good for testing purposes.</p><p>But as the dataset is big, I was having issues loading it. While testing it with Pillow(link), the CPU Memory usage went up to 600% and Max RAM Usage went up to 5.35/8 GB and it took around 55 mins to load the entire train image dataset. So I wrote a Python InterOp based Dataset Randomization Function to extract randomized subset of Imagenette using a seed of 42 that selected 100 images from each class(10 classes) to have a balanced dataset. It extracts and copies the images in a new folder along with maintaining the folder structure of original dataset.</p><p>The code can be found here:</p><p><a href="https://github.com/ayushi2103/SwiftImageLoader/blob/master/subsetImagenette/subsetImagenette/subsetImagenette.swift">https://github.com/ayushi2103/SwiftImageLoader/blob/master/subsetImagenette/subsetImagenette/subsetImagenette.swift</a></p><p><strong>2. Establish a good benchmark.</strong></p><p>For benchmarking, we used</p><p><a href="https://github.com/google/swift-benchmark.git">https://github.com/google/swiftbenchmark.git</a></p><p>It&#39;s a google library in swift to benchmark code snippets. Using this library, I wrote a generalized benchmarking library which uses the generated subset of imagenette containing 100 images from each class for 160 and 320px images.</p><p><strong>3. Identify the fastest library.</strong></p><p>We considered 5 libraries in the beginning to figure out the The fastest library was Nvidia DALI and the second fastest library was JPEGTurbo. As Nvidia DALI requires GPU to run we decided to go for JPEGTurbo to cater more people. We do have a future goal of adding Dali for GPU instances and JPEGTurbo otherwise.</p><p><strong>4. Used flame graphs to find out the most stable library.</strong></p><p>We used Flame Graphs to find out about any unnecessary operation that could be happening that can affect our results.</p><p><a href="https://github.com/brendangregg/FlameGraph">GitHub - brendangregg/FlameGraph: Stack trace visualizer</a></p><p>The graphs can be found here:</p><p><a href="https://github.com/ayushi2103/SwiftImageLoader/tree/master/Flame%20Graphs">ayushi2103/SwiftImageLoader</a></p><p><strong>5. Documentation</strong></p><p>I have provided all my findings in the readme <a href="https://github.com/ayushi2103/SwiftImageLoader/blob/master/README.md">https://github.com/ayushi2103/SwiftImageLoader/blob/master/README.md</a></p><h4>Milestone 2</h4><p><strong>Linking TurboJPEG with Swift</strong></p><p>I used package managers for the first time and I did have a couple of issues making it work. I feel CMake is a much better option than SPM as it provides cross compilation and cross language support and SPM is problematic with external libraries.</p><ol><li><strong>Using Swift Package Manager</strong></li></ol><p>I was able to create a package using Swift Package Manager but we had to download library locally but it was not helping our cause as we wanted a shared library.</p><p>Code can be found here:</p><p><a href="https://github.com/ayushi2103/SwiftLibjpegTurbo/blob/master/README.md">ayushi2103/SwiftLibjpegTurbo</a></p><p>It also used unsafe flags to link with on-system TurboJPEG and can be seen here:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7872129909db36abb5045b1c8b83d2ab/href">https://medium.com/media/7872129909db36abb5045b1c8b83d2ab/href</a></iframe><p>I tried adding SwiftLibjpegTurbo package as a dependency to swift-models to see if I can use that to get access to TurboJPEG functions inside swift-models. But when trying to access the system’s TurboJPEG, we end up with the error — “cannot be used as a dependency of this target because it uses unsafe build flags.”</p><p>As I ran into all these issues, I tried making it work with CMake.</p><p><strong>2 . Using CMake</strong></p><p>CMake is a meta build system that uses scripts called CMakeLists to generate build files for a specific environment.</p><p>My mentor helped me in the beginning to give me a headstart for CMake. I figured there are not enough resources for Swift for CMake but compnerd’s Swift Build Examples helped me understanding CMake for swift.</p><p><a href="https://github.com/compnerd/swift-build-examples">compnerd/swift-build-examples</a></p><h4>Milestone 3</h4><p>Integrating JPEGturbo in Swift-Models</p><p><a href="https://github.com/tensorflow/swift-models/tree/master/ImageLoader">tensorflow/swift-models</a></p><ol><li><strong>Image Data</strong></li></ol><p>I used an ImageData class to store image variables that is used in saving and loading functions. It forms a single returnable entity which can be associated with the data of the image content and can be easily tracked. It also helps in giving the future loaders the ability to have a similar api for easy swapping.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/571435b8cfb678dfc4a2a29819596ed2/href">https://medium.com/media/571435b8cfb678dfc4a2a29819596ed2/href</a></iframe><p><strong>2. Loading Function</strong></p><p>loadJPEG is a loading function that takes the image path and Pixel Format as parameters and returns ImageData — a class object containing the height, width, PixelFormat and a pointer to the image buffer of output image.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5354e558d4c670594b82dc68ba1cb557/href">https://medium.com/media/5354e558d4c670594b82dc68ba1cb557/href</a></iframe><p><strong>3. Saving Function</strong></p><p>saveJPEG is the saving function that takes the new image path and the imageData object associated with the image-to-be-saved, thereby saving the image accordingly.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/73581405e64a9a0614987df372700497/href">https://medium.com/media/73581405e64a9a0614987df372700497/href</a></iframe><p>My pull request can be found here:</p><p><a href="https://github.com/tensorflow/swift-models/pull/649">https://github.com/tensorflow/swift-models/pull/649</a></p><h3><strong>Future Goals</strong></h3><ul><li><strong>Providing PNG Support</strong></li></ul><p>It should be able to load and save images in PNG format as well using loadPNG as JPEGTurbo doesn’t process PNG images.</p><ul><li><strong>Integrating Nvidia Dali for GPU supported acceleration</strong></li></ul><p>During benchmarking, Nvidia Dali was the fastest with 36x improvement, and it would make sense to add it as an option for GPU instances with a fall back option on JPEGTurbo.</p><ul><li><strong>Adding Image Manipulation Functions</strong></li></ul><p>I have already benchmarked Image manipulation functions but we also have an option of building our own flexible pipelines using X10s for more performance optimization.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56b4195c50b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC 2020, Becoming an Open-Source Contributor]]></title>
            <link>https://medium.com/@ayushitiwari2103/gsoc-2020-becoming-an-open-source-contributor-2a118282a239?source=rss-ab7b971bd6ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a118282a239</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[gsoc-2020]]></category>
            <category><![CDATA[swift-for-tensorflow]]></category>
            <dc:creator><![CDATA[Ayushi Tiwari]]></dc:creator>
            <pubDate>Tue, 09 Jun 2020 05:07:45 GMT</pubDate>
            <atom:updated>2020-06-09T05:49:47.804Z</atom:updated>
            <content:encoded><![CDATA[<p>On May 4th, 2020, I received an email stating that I was selected for Google Summer of Code, 2020. I will be working under the TensorFlow Organization this summer and I am pretty excited about it. Also, I have decided to share my journey with all of you, while guiding people and blogging my updates on my project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RlnlPoTXs6qm7j_n635cyg.png" /></figure><p><em>A little bit about me and the project:</em></p><p>I am a second-year computer engineering student at the University of Waterloo and my interests lie in iOS Development and Machine learning and I love to build stuff and explore new technologies.</p><p>During GSoC, I am working with the <a href="https://www.tensorflow.org/swift">Swift for TensorFlow</a> team on a fast Cross-Platform Library for Image loading in Swift.</p><p>Getting selected for Google Summer of Code looks very intimidating, and to be honest, the acceptance email caught me by surprise too. Just to make it a bit easier, I would like to break down the process.</p><p><strong>STEP 1: Get to know about GSoC</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xN1nqrZ-4p2IeY4cfV_f6w.png" /></figure><p>So <a href="https://summerofcode.withgoogle.com/">Google Summer of Code</a>, abbreviated as GSoC, is a global fellowship program to excite college students to do Open Source contribution and also support open source organizations and have free code released for the benefit of the community.</p><p>As a student developer, you will be matched with mentors in the same organization and will gain real-world software development experience and a stipend depending on the country of your university!</p><p>My cousin mentioned GSoC to me and then I went through the website, read tonnes of blogs, watched videos and talked to last year students and it was enough to excite me!</p><p>One thing I would like to mention is, please check your<a href="https://summerofcode.withgoogle.com/get-started/"> eligibility</a>. Though it accepts all university students from all career fields, who are at least 18 years old at the time of applying.</p><p><strong>STEP 2: Learn the Basics</strong></p><p>As an open-source programmer, you should be familiar with at least 1 programming language and should know the basics of Data Structures and Algorithms to maintain good coding practices.</p><p>If you’re a beginner, you can start with learning a language and learning algorithms. There are a lot of online resources available. One website that helps me to find the most trending courses when I want to learn some new tech stack is <a href="http://hackr.io/">hackr.io</a>. It might be helpful.</p><p>I started my programming path with C++ and Python. C++ is a middle-level language so it was hard for me in the beginning compared to Python but it helped me have a better grasp on concepts. After a while, I started with iOS Development and learned Swift. I adore Swift now as it has an easy syntax like Python but is fast like C++, though it was created in Apple, Swift has evolved into a cross platform language with a very friendly and active community. Along with that it’s completely open-source and can easily work along with many languages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ghijeKCe46nnnXosqXdSNA.png" /></figure><p>After that, the most important thing in open source is version control. The most used one is Git and GitHub is the version control platform. I won’t go in detail but <a href="https://guides.github.com/introduction/git-handbook/">https://guides.github.com/introduction/git-handbook/</a> this guide would help you to get accustomed to the basic commands.</p><p>After this step, you will be ready to try your hands in open source contribution.</p><p><strong>STEP 3: Selecting the Organization</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0WW5-hdPxMF-KbvWAAYBoQ.png" /></figure><p>GSoC selects a lot of organizations every year and all of them have interesting projects in different areas and languages. So one should choose the organization based on the interest and passion while keeping in mind that the organization may not be selected the next year.</p><p>So according to me choose it based on:</p><ol><li><em>Interest</em></li><li><em>Tech Stack and the Project</em></li><li><em>How big is the organization</em></li><li><em>Community</em></li></ol><p>I chose TensorFlow because they had interesting Swift projects and working on the language on MacOS was intriguing for me. Also, a friend shared the idea with me and creating a Swift library was something I wanted to do.</p><p>You can go through the organization list of the previous year, go through the projects and I am sure something would intrigue you. After that, you can visit the GitHub account of the organization, go through the ReadMe and set up the environment on your local machine. I feel it’s the best way to get acquainted with the codebase.</p><p>A lot of organizations would like to select a student who is already familiar with their community and the codebase so people with open source contributions are preferred. You can begin with extremely basic issues and it would be a good starting point.</p><p><em>The biggest mistake I made was starting very late and I had no time to contribute, but it would have helped me in the later stages too I feel.</em></p><p>After selecting the organization, you can go through their communication channels and mailing lists, where you can introduce yourself and ask for help. GSoC is just not about coding but also building the bond with the community. It also helps you to build soft skills and asking technical questions which are important throughout.</p><p><strong>STEP 4: Register and Note the Timeline</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tkhqo1BKelBwOaNeBjG1XQ.png" /></figure><p>Around January the program is announced, so please keep visiting the website around that time and keep an eye on the timeline. So go through the organizations once they are selected and make sure your organization is selected. Also, don’t forget to register and apply. The deadlines are pretty strict.</p><p>The organizations also release an ideas list and you might find something that interests you. I feel choosing the idea would be better as its something the organization is interested in and your idea might not be in their scope.</p><p><strong>STEP 5: Writing a Good Proposal</strong></p><p>The proposal is the most important step in getting selected as it is your moment to make the mentors interested in you. You have to convince them that you are passionate, knowledgable and hard working.</p><p>As its a technical proposal, you should mention your project features and also why you would go through the particular path. A lot of people advised me to work on a prototype as it gives you more clarity and helps in adding all the technical aspects.</p><p>You should add all the things about you that make you fit for the project, your work experience and projects.</p><p>Also, please mention why the project would be beneficial to society.</p><p>You can go through the <a href="https://google.github.io/gsocguides/student/writing-a-proposal">GSoC Sample Proposal</a> for having the basic idea.</p><p><em>This is my </em><a href="https://docs.google.com/document/d/1qZjgQLq-koOfoPVMwsc0Kk4T-hutNfKagg5W8Li0mfA/edit?usp=sharing"><em>proposal</em></a><em> for reference.</em></p><p>Also, you can share the draft proposal in your dashboard for some feedback or share it in the organization and it helps you get a better understanding of the expectations and scope of the project.</p><p>After submitting the project you just have to wait for the results!</p><p><em>My </em><a href="https://github.com/ayushi2103/SwiftImageLoader"><em>GitHub project link</em></a><em> is available here if someone is interested.</em></p><p><em>In the end, I just want to thank my mentors </em><a href="https://www.linkedin.com/in/dynamicwebpaige/"><em>Paige Bailey</em></a><em>, </em><a href="https://www.linkedin.com/in/abdulras/"><em>Saleem Abdulrasool</em></a><em>, </em><a href="https://github.com/BradLarson"><em>Brad Larson</em></a><em> and </em><a href="https://www.linkedin.com/in/ayush517/"><em>Ayush Agrawal</em></a><em> for giving me this opportunity and helping me throughout. Ayush and </em><a href="https://www.linkedin.com/in/karthikriyer2/"><em>Karthik</em></a><em> helped me a lot with the idea and the proposal and I am always thankful to them.</em></p><p><em>Please ping me on</em><a href="https://www.linkedin.com/in/ayushi21/"><em> LinkedIn</em></a><em> or </em><a href="http://ayushitiwari2103@gmail.com/"><em>email</em></a><em> me, if you have any questions regarding GSoC, open-source contribution, my project or if you guys want to share anything!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a118282a239" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>