<?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 Jaskaran Virdi on Medium]]></title>
        <description><![CDATA[Stories by Jaskaran Virdi on Medium]]></description>
        <link>https://medium.com/@jaskaranvirdi?source=rss-2bed2911b3a1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1EhEAJdzleFuHdHIHmvMOg@2x.jpeg</url>
            <title>Stories by Jaskaran Virdi on Medium</title>
            <link>https://medium.com/@jaskaranvirdi?source=rss-2bed2911b3a1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 00:56:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jaskaranvirdi/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[Learnings from attending my first machine learning conference in Silicon Valley- Train AI 2018]]></title>
            <link>https://medium.com/@jaskaranvirdi/attending-train-ai-2018-my-first-machine-learning-conference-in-silicon-valley-a82dc87e9053?source=rss-2bed2911b3a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/a82dc87e9053</guid>
            <category><![CDATA[silicon-valley]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Jaskaran Virdi]]></dc:creator>
            <pubDate>Sun, 15 Jul 2018 19:28:20 GMT</pubDate>
            <atom:updated>2018-07-31T23:36:10.711Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uHviOSrhek3R_B_15Qrq6g.jpeg" /><figcaption>Garry Kasparov, former world chess champion, talking about the human-machine future</figcaption></figure><p>Train AI is a conference geared towards applying machine learning to solve real business problems in the software industry. This year it was held at the stunning and picturesque Pier 27 in San Francisco on May 9 and 10.</p><p>The first day(May 9) was an Introduction to Deep Learning session for engineers who wanted to get more hands-on experience designing and debugging neural networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f_sCdxMctO8Q5PJMJ1cKkA.jpeg" /><figcaption>Welcome!</figcaption></figure><p>The second day(May 10) started with a keynote from Garry Kasparov, former world chess champion and considered one of the greatest chess players of all time. In his keynote titled, “From Competition to Collaboration, the Human-Machine Future”, he reflects upon his famous match loss to the IBM supercomputer Deep Blue and instead of being bitter about it he emphasizes on why AI should not be thought of as Artificial Intelligence but more so as Augmented Intelligence. This take on augmented intelligence points to a positive human-machine future rather than the grim “Machines/AI are going to take our jobs” narrative. His talk focusses on the positive role businesses must play in moving AI from the laboratory into the mainstream and how the new generation of machine learning can create knowledge that contributes to real insight and understanding, not merely efficiency. Kasparov wants us to be optimistic and ambitious about the reality and potential of intelligent machines, what he calls a self-fulfilling prophecy.</p><p>The second talk was from Robert Munro, CTO, Figure Eight titled “Real World Human-in-the-Loop Machine Learning”. I think the most interesting part of the talk were the free datasets being provided for the machine learning community. These datasets span across a variety of fields like Open Images Dataset v4(Bounding boxes) for object detection; Medical Images for Nucleus Segmentation; Handwriting Recognition; San Francisco Parking Sign Detection; Medical Information Extraction; Medical Speech, Transcription, and Intent (English); Swahili Health Translation, Speech, Transcription, and Topics; Multilingual Disaster Response Messages. You can find these datasets here at <a href="https://www.figure-eight.com/datasets/">https://www.figure-eight.com/datasets/</a></p><p>The third talk I attended was “Challenges &amp; Design Patterns for Conversational AI” by Peter Skomoroch, Co-Founder and CEO, SkipFlag(acquired by Workday). Peter talks about the lessons learned from the recent wave of conversational bots and from building SkipFlag, an intelligent knowledge base which resolves issues and questions on JIRA, Zendesk and Slack. I liked this talk because it gives a nice summary about the common problems in building conversational AI agents and some of the current approaches being used to solve such problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kxb0J1jam8fX-1D83EXiqg.png" /><figcaption>Important scenarios in AI conversations (Source: Peter Skomoroch slides)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WJ4adNKelBXUDqedxE3l_g.png" /><figcaption>Common approaches to Conversational AI (Source: Peter Skomoroch slides)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sVUZ8auf2LuVQlssW9VRjQ.png" /><figcaption>A simple rule based bot which keeps a running count of items in grocery list. (Source: Peter Skomoroch slides)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a7jW71PbhMGYyFnxV0wQcA.png" /><figcaption>The utterance is parsed and decomposed into Intent and its slot value (Source: Peter Skomoroch slides)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vh1b1f8419qX2ODjcLjuCw.png" /><figcaption>Based on the Google paper, Smart Reply functionality is a deep learning approach used by Gmail to generate possible replies to an email (Source: Peter Skomoroch slides)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EDyxO5JaVPAZsiz8dbc1lA.png" /><figcaption>Trying to answer questions based on a passage of text. A hot area of NLP research for conversational AI agents (Source: Peter Skomoroch slides)</figcaption></figure><p>The next talk titled “Productizing Deep Learning for the Enterprise” by Hanlin Fang, Director Of Machine Learning Product Management, Workday was about developing a receipt scanning product for expense reimbursement. This was an interesting talk about how machine learning and computer vision can be used for receipt scanning and cutting down time for filing expense reports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bM-rGFSyVse5W4lGtGyNtw.png" /><figcaption>Given a receipt, the application should fill in all the relevant fields automatically and submit the expense report (Source: Hanlin Fang slides)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fQePe-w5D_LdNAzEy2kwpw.png" /><figcaption>Three Steps to ML Service Development (Source: Hanlin Fang slides)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AA5OmrL5ITN08SiDsADXtA.png" /><figcaption>Questions asked during Solution Exploration stage (Source: Hanlin Fang slides)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GjEeupSTYtif9vPb1E_IoQ.png" /><figcaption>Why industry uses Deep Learning (Source: Hanlin Fang slides)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*srw7jnaQPfvpq2QvxmHd7w.png" /><figcaption>Development process for Receipt scanning consists of FOI detection, Text recognition followed by a Parser (Source: Hanlin Fang slides)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AfZ6OVxIOhyiDEoXXijuzw.png" /><figcaption>Questions to be answered during the Model Deployment Process (Source: Hanlin Fang slides)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bZ-8J9TYa6YePawIbuL4dA.png" /><figcaption>A dashboard showing a machine learning model in production deployed as a service, one can see the number of incoming requests, the number of failures and the request duration (Source: Hanlin Fang slides)</figcaption></figure><p>Last but not the least, the headliner talk was “Building the Software 2.0 Stack” by Andrej Karpathy, Director of AI, Tesla. In this talk, Andrej speaks about a new transformation which could possibly be the future of software aka Software 2.0 and how it is being used on AutoPilot at Tesla</p><h4><strong>Andrej Karpathy on Software 2.0 …</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GmdRTg9Oj8wAa_na9nQaPw.png" /><figcaption>The usual software engineering process (Source: Andrej Karpathy slides)</figcaption></figure><p>Software 1.0 is essentially the current software engineering process which consists of decomposing the problem, designing the algorithms, composing it into a system(stack) and then measuring performance. This approach has created some great software stacks such as TCP/IP stack, the AWS stack and Android Software Stack. However, Software 1.0 has its limits when creating an image recognition stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-0kE-mHF7K5vQzU0IL-LKQ.png" /><figcaption>Software 1.0 fails for the recognition stack. Thus, the need for Software 2.0 (Source: Andrej Karpathy slides)</figcaption></figure><p>So, how do we build an image recognition stack? How do we go from a matrix of pixel intensities to recognizing the content of that image?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZrC95t9vs0iOfaEG_JGITA.png" /><figcaption>The State of the Art approaches take a different form based on amount of data available (Source: Andrej Karpathy slides)</figcaption></figure><p>In the above slide, one can see a trend that as the complexity of the image recognition task increases, the state of the art approaches take on a different form. So, in the beginning when a lot of data isn’t available then a lot of feature engineering and hardcoded features have to be designed for coming up with a recognition stack. But as the data increases, the engineering required is less and gets off loaded to the optimization, in this case learning the weights for a neural network for image recognition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6xtgV3WCI33zS3zhXXkWJA.png" /><figcaption>In Software 2.0, one will define a code skeleton similar to a neural net architecture and learn the weights (Source: Andrej Karpathy slides)</figcaption></figure><p>Thus, Software 2.0 is a learned system unlike Software 1.0 which is an engineered system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HFs11Scb6ttv6SBHhhbHrw.png" /><figcaption>In Software 2.0, optimization will help you in getting to a more complex program (Source: Andrej Karpathy slides)</figcaption></figure><p>The above slide shows the Program space which is a set of all programs to solve a given problem, where the program complexity increases as one goes away from the origin. The Software 1.0 solution to the problem of image recognition is essentially a point in this space. The Software 2.0 solution, however is a subspace of this program space and the solution can be arbitrarily complex based on the optimization(in this case gradient descent is being used to simultaneously satisfy the labels of all the images in the training dataset)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iXX2pFCPyX4lWUM0DXvCHw.png" /><figcaption>Software 2.0 will still need Software 1.0 (Source: Andrej Karpathy slides)</figcaption></figure><p>This doesn’t mean that Software 2.0 will completely replace Software 1.0 in all surface areas. For example: In the above slide, to compile and deploy 2.0 code, you need a huge amount of 1.0 infrastructure.</p><p>There are a lot of benefits to Software 2.0:</p><ol><li><strong>Computationally homogeneous</strong></li></ol><p>In case of a ResNet, the operations performed from the input layer to the output layer are extremely homogeneous -convolution, activation and pooling.</p><p>2. <strong>Hardware Friendly</strong></p><p>Because it is so computationally homogeneous, it is also hardware friendly.</p><p>3. <strong>Constant Running Time and Memory Use</strong></p><p>The forward pass of a neural net will always take exactly the same amount of time and memory. For example: In the case of a self-driving car or any real-time system, this property provides guarantees on the run time and memory use.</p><p>4. <strong>Agile and Finetuning</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1r8VIPt-B4nymUV1xUn0yQ.png" /><figcaption>Software 2.0 is much more agile than Software 1.0 (Source: Andrej Karpathy slides)</figcaption></figure><p>Software 2.0 is much more agile or easier to finetune. For example: If you would like code with same functionality but like to run it faster, even if it means slightly worse results. You can do this trivially in Software 2.0, by reducing the number of channels and retraining the network. This kind of change is very difficult in case of Software 1.0, as one would have to profile the code, and rewrite it accordingly.</p><h4><strong>Andrej Karpathy on autonomous driving at Tesla …</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ufzKPY00CHO981dtxK1hw.png" /><figcaption>How the code on the Tesla Autopilot looked like initially (Source: Andrej Karpathy slides)</figcaption></figure><p>The above slide shows the inputs to the Tesla Autopilot which is the data coming from sensors such as cameras, radar and IMU. The output of the system are scalars for steering and acceleration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3xaZG70n1fgQ94H6d5B5JQ.png" /><figcaption>2.0 code on the Tesla Autopilot has increased over time i.e more deep learning (Source: Andrej Karpathy slides)</figcaption></figure><p>Over time, the amount of Software 2.0 in Tesla Autopilot has increased. More and more of the software is being replaced by neural networks.</p><h4>Andrej Karpathy on lessons learnt at Tesla …</h4><h4><strong>Lesson #1: Data labelling is highly non-trivia</strong>l</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hPt134LHxC9NhwWfxDBW_Q.png" /><figcaption>Labelling lane lines — a relatively trivial example (Source: Andrej Karpathy slides)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gs0T0fzcnMlFAdoW5NiaoA.png" /><figcaption>Labelling lane lines — a conundrum (Source: Andrej Karpathy slides)</figcaption></figure><h4>Lesson #2: Chasing Label/Data Imbalances is non-trivial</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WJ37MpTzuJZGE9Fso25fvw.png" /><figcaption>Data imbalance for vehicle classification in autonomous driving (Source: Andrej Karpathy slides)</figcaption></figure><h4>Overall lesson learnt: Toolchain for 2.0 stack doesn’t yet exist</h4><p>For Software 1.0, we have a lot of tooling such as IDEs which help us program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QtCbM6qcxzlHwXo4-LVIqw.png" /><figcaption>An example of Software 1.0 IDE (Source: Andrej Karpathy slides)</figcaption></figure><p>But currently, there is no such thing for Software 2.0</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FgvzeAnoaZm2gzLzkWdlRQ.png" /><figcaption>Some interesting ideas for Software 2.0 IDEs (Source: Andrej Karpathy slides)</figcaption></figure><h4>My thoughts on TrainAI…</h4><p>Overall, I had a great experience learning about how tech companies are leveraging their data to use machine learning based solutions for their business needs and the lessons they learnt in implementation and deployment of such solutions. The talks were insightful and it was a great venue to hold a conference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IiP8o0nF-FHREtUSsFj44g.jpeg" /><figcaption>San Francisco skyline from Pier 27</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W68Z2PDShmm7-WaZ7ShnhA.jpeg" /><figcaption>Post Q&amp;A with Andrej Karpathy</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a82dc87e9053" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up OpenCV and C++ development environment in Xcode for Computer Vision projects]]></title>
            <link>https://medium.com/@jaskaranvirdi/setting-up-opencv-and-c-development-environment-in-xcode-b6027728003?source=rss-2bed2911b3a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6027728003</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[xcode]]></category>
            <dc:creator><![CDATA[Jaskaran Virdi]]></dc:creator>
            <pubDate>Wed, 03 Jan 2018 08:55:39 GMT</pubDate>
            <atom:updated>2018-01-03T23:10:57.275Z</atom:updated>
            <content:encoded><![CDATA[<p>Xcode is a free and excellent IDE not only for creating iOS apps but also for C++ development and working on computer vision projects using OpenCV. After interviewing with some companies in Silicon Valley, I got to know that a lot of commercial AR software such as Snap Lenses, Instagram’s Filters, Apple’s Animoji, etc. is written in C++ to maximize performance on resource constrained devices such as mobile phones and tablets. A lot of the new features in OpenCV are first available in C++ and then introduced to Python since OpenCV is natively written in C++ and provides bindings for Python, Java and MATLAB.</p><p>Unfortunately, I used Python with OpenCV for computer vision for ease of use since Python is much more readable, easier to code than C++ and setting the development environment is easier too. However, Python is not used for computer vision in industry and thus the motivation for writing this.</p><p>This post goes through setting up OpenCV and C++ environment on MacBooks which is actually the hardest part for a beginner starting in computer vision because of lack of trustworthy documentation since most tutorials online deal with setting up the environment for Python and a very less percentage of them deal with setting it up on Xcode.</p><ol><li><strong>Install Xcode</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rdpkZHGE68jxhcpkftblLQ.png" /><figcaption>Search for Xcode in top right corner after opening App Store and click on Xcode</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jdzBWByEu_LEpRx2ogMSaA.png" /><figcaption>Click on the Get button to start the installation. It changes to Open after Xcode is installed.</figcaption></figure><p>Install Xcode from the App Store. Open the App Store and search for Xcode and then click the Get button(in my case it shows Open because I have Xcode installed). Since, Xcode(9.2) setup size is about 5.5 GB it may take about 30–60 minutes to install depending on the internet speed.</p><p>2. <strong>Install Homebrew</strong></p><p>Aptly titled ‘The missing package manager for macOS’, enough said. <a href="https://brew.sh/">Homebrew</a> is the macOS equivalent of the Ubuntu/Debian-based <em>apt-get</em>. For the installation, just open a terminal and paste:</p><pre>/usr/bin/ruby -e &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&quot;</pre><p>3. <strong>Install OpenCV</strong></p><p>To install OpenCV using brew, open a terminal and paste:</p><pre>brew install opencv</pre><p>This should install OpenCV 3.</p><p>4. <strong>Install pkg-config</strong></p><p>pkg-config is a helper tool used when compiling applications and libraries. It helps you insert the correct compiler options on the command line rather than hard-coding values. This will be helpful for finding the correct linker flags for OpenCV. This will be more clear in the subsequent steps.</p><p>To install pkg-config using brew, open a terminal and paste:</p><pre>brew install pkg-config</pre><p>5. <strong>View OpenCV linker flags</strong></p><p>To view the linker flags for OpenCV, run:</p><pre>pkg-config --cflags --libs opencv</pre><p>The output looks like:</p><pre>-I/usr/local/Cellar/opencv/3.3.1_1/include/opencv -I/usr/local/Cellar/opencv/3.3.1_1/include -L/usr/local/Cellar/opencv/3.3.1_1/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_photo -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dpm -lopencv_face -lopencv_fuzzy -lopencv_img_hash -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_dnn -lopencv_plot -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ml -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_flann -lopencv_xobjdetect -lopencv_imgcodecs -lopencv_objdetect -lopencv_xphoto -lopencv_imgproc -lopencv_core</pre><p>The above shows you the includes and the libraries for OpenCV.</p><p>In case the command to get linker flags doesn’t work, you might need to specify the location of opencv.pc file:</p><pre>pkg-config --cflags --libs path/to/opencv.pc</pre><p>My opencv.pc file is located at</p><pre>/usr/local/Cellar/opencv/&lt;version_number&gt;/lib/pkgconfig/opencv.pc</pre><p>Yours should be on a similar path.</p><h3><strong>Running your code on the terminal</strong></h3><p>Paste the below line which compiles the OpenCV code with the appropriate linker flags.</p><pre>g++ $(pkg-config --cflags --libs opencv) -std=c++11  yourFile.cpp -o yourFileProgram</pre><p>Run the binary,</p><pre>./yourFileProgram</pre><h3>Running your code in Xcode</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*78N36_pb9JiUo0KA4xZ_Mg.png" /><figcaption>Set Language as C++ for the new Command Line Tool project</figcaption></figure><p>Before following the below steps to run OpenCV C++ code in Xcode, you first need to create a C++ project in Xcode.</p><ul><li>Click on <em>File&gt;New&gt;Project</em></li><li>Under <em>Choose a template for your new project </em>click on <em>macOS</em></li><li>Under <em>Application </em>click on <em>Command Line Tool</em></li><li>You should get the above screen. Fill in the details and set the <em>Language </em>to C++</li></ul><p><strong>Set Header Search Paths</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dw-XFQ22CQkeVYVqFEfNfw.png" /><figcaption>Setting Header Search Path in Xcode</figcaption></figure><p>To set Header Search Path in Xcode, first click on the Xcode project(computer vision in this case) and then go to Build Settings and then search for Header Search Paths.</p><p>Set the Header Search Path to the path of OpenCV include folder. In my case, this is:</p><pre>/usr/local/Cellar/opencv/&lt;version_number&gt;/include</pre><p><strong>Set Library Search Paths</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hx5i0eguGinpeAeMeslYeQ.png" /><figcaption>Setting Library Search Path in Xcode</figcaption></figure><p>In this case, follow steps similar to <strong>Set Header Search Paths </strong>above but search for <strong>library search paths </strong>in the search bar.</p><p>Set the Library Search Path to the path of OpenCV library folder. In my case this is:</p><pre>/usr/local/Cellar/opencv/&lt;version_number&gt;/lib</pre><p><strong>Set Other Linker Flags</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PGBx03RXNW2ZNlWqrJgh-g.png" /><figcaption>Set Other Linker Flags in Xcode</figcaption></figure><p>Search for other linker flags in the search bar.</p><p>Set the other linker flags with all the flag values obtained after running pkg-config command above.</p><h4>Run code</h4><p>You are all set to run your OpenCV project in Xcode. Press Cmd+R to run your Xcode project.</p><h4>Passing arguments to your code</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RlWQWsroyikcHfUEkanvoA.png" /><figcaption>Click on the scheme selector to set your active scheme(computer vision in this case) and then click on Edit Scheme</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*guTTh1kSbpAsvo6XzHaWLw.png" /><figcaption>In the Edit Scheme, add the required arguments or environment variables needed by your source code</figcaption></figure><p>In case you want to pass arguments such as an image file to your Xcode project, you will need to edit scheme as shown above.</p><h4>Using relative file paths</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b8zNW-tSLBIOanH4SLgd_Q.png" /><figcaption>Setting Working Directory for relative file paths in Xcode</figcaption></figure><p>Xcode uses the absolute path of the image or resource. In order to set relative paths, you need to set the <em>Working Directory.</em> To do that, in <em>Edit Scheme </em>go to the <em>Options</em> tab in <em>Run</em> and check <em>Use Custom</em> <em>Working Directory </em>and add the project directory name.</p><h4>Multiple files in same project</h4><p>The project will fail to build in case you have multiple C++ files for a given project. In this case, you will need to create Targets within your project, where each Target corresponds to a C++ file.</p><p><strong>References</strong></p><p><a href="https://medium.com/@dkw5877/opencv-on-os-x-sierra-436f4adbb463">OpenCV on OS X Sierra</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6027728003" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>