<?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 Oznur Akgun Yusuf on Medium]]></title>
        <description><![CDATA[Stories by Oznur Akgun Yusuf on Medium]]></description>
        <link>https://medium.com/@oznurakgun?source=rss-dcff8eac9594------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0BU57nW1ACdZ5LI4yzsRfA.png</url>
            <title>Stories by Oznur Akgun Yusuf on Medium</title>
            <link>https://medium.com/@oznurakgun?source=rss-dcff8eac9594------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 01:51:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@oznurakgun/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[Hand Pose Detection with CoreML and Vision Framework]]></title>
            <link>https://medium.com/@oznurakgun/hand-pose-detection-with-coreml-and-vision-framework-e15d11e008bd?source=rss-dcff8eac9594------2</link>
            <guid isPermaLink="false">https://medium.com/p/e15d11e008bd</guid>
            <category><![CDATA[swif]]></category>
            <category><![CDATA[coreml]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[vision-framework]]></category>
            <dc:creator><![CDATA[Oznur Akgun Yusuf]]></dc:creator>
            <pubDate>Sun, 21 Nov 2021 12:46:16 GMT</pubDate>
            <atom:updated>2021-11-21T17:46:39.077Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mf8d3mbSLuDtMIsH.png" /></figure><p>I created sample app about core ml that I’ve wondered for a while. And i want to share it with you.</p><p>In this tutorial, We will get finger point from camera and we will detect finger sign by coreml</p><p><strong><em>At firstly, we need 4 main title,</em></strong></p><p>1- Setting Up Vision Framework</p><p>2- Creating finger sign dataset by getting hand gesture data from<strong> </strong>vision framework</p><p>3- Creating CoreML model</p><p>4- Detecting Finger Sign With CoreML</p><p><strong><em>Setting Up Vision Framework;</em></strong></p><p>With vision framework, apple is making it easy for developers to use complex image processing algorithms. Now, developers can simply use complex processing image algorithm like animal detection, barcode detection, object recognition. (you can visit this site to see all list <a href="https://developer.apple.com/documentation/vision">https://developer.apple.com/documentation/vision</a>)</p><p>We will use VNDetectHumanHandPoseRequest that can detect fingers and can give us detected finger points</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe6cfac4da70cce259a6346aa1de461f/href">https://medium.com/media/fe6cfac4da70cce259a6346aa1de461f/href</a></iframe><p>(1): Number of tracked hand at same time. It’s 2 by default.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/76ce5980901510c68767a91173c56dd4/href">https://medium.com/media/76ce5980901510c68767a91173c56dd4/href</a></iframe><p>(1): We don’t want to handle more than one hand.</p><p>(2): That’s it! Now, we have fingers point</p><p>(3): We got top point of thumb. By the way, you can see all key in photo</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*dvdLYc6te2KlI2i1YbEhrQ.png" /></figure><p><strong><em>Creating finger sign dataset by getting hand gesture data from vision framework;</em></strong></p><p>Now, we have code that can handle point when hand is detected and we want to show finger sign for users hand. If we had dataset that contains all finger signs point and result we could give current point to a dataset and we could get predicted result. In that case, we should create dataset first.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f708385cf9845081e567afc2f6d0120/href">https://medium.com/media/3f708385cf9845081e567afc2f6d0120/href</a></iframe><p>This code is getting 2000 fingers point and adding them to a string. At the end, it is converting the string to csv format and saving to phone’s local file system.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/782f446d145a9ede67332e6a53f76a01/href">https://medium.com/media/782f446d145a9ede67332e6a53f76a01/href</a></iframe><p>We call this function from captureOutput. In this way, every time captureOutput(when hand is detected by vision framework) is called, a line will be added to csvString. When repeated 2000 times, csv file will be created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*S8w1jDJxaVUSasqvvPxODg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*JXvPJhOA5mqZbo1UhBdUBg.gif" /></figure><p>We show same sign to camera over and over again then sign information line is added to csv file 2000 times. One line looks like this;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*fsSUGCOcKycDTIxQR_47lw.png" /></figure><p>By the way, there is more column between <strong>result</strong> and <strong>thumbCMCy</strong> but i had to cut to get screenshot. Result is the key of the sign. I selected different numbers for different hand signs. Keys like this in this project are 1-👍 2 -🖐 3-👌 5-👇 6-👊 8-🤟</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*gtPdMVa0VyvULkVd6Pg3Mw.png" /></figure><p>You can get the csv file from phone by above steps. By the way, you need to open file sharing to see files in this list. To open file sharing, set true `Application supports iTunes file sharing` key in Info.plist file</p><p>After finished to creating files, we merge all csv files to get one file. <br>(I used <a href="http://merge-csv.com/">http://merge-csv.com</a>) Now, we have long dataset that contains all points information.</p><p><strong><em>Creating CoreML model;</em></strong></p><p>Open CreateML app, select tabular classification and then set project name and then select next</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*gDo127upEL2YyRqwF6Xxzw.png" /></figure><p>Select the csv file that we created as training data. Below, click <strong>result</strong> as target and click the others as feature. Important point; selected target shouldn’t be diffirent for every item. (like id)</p><p>You can create small file for testing by the same way or can seperate small part from the dataset we created. (<a href="https://stackoverflow.com/questions/38250710/how-to-split-data-into-3-sets-train-validation-and-test/38251213#38251213">https://stackoverflow.com/questions/38250710/how-to-split-data-into-3-sets-train-validation-and-test/38251213#38251213</a>) After that, click train</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*UtYJJP253mXrwng9dXc-mQ.png" /></figure><p>Our model is ready in a few seconds :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*3Bt-rLMLxS2HJ1szBJP7rg.png" /></figure><p><strong><em>Detecting Finger Sign With CoreML;</em></strong></p><p>Now, there are two parts. One of them can get points information and returns result, the other can get finger point locations. We need only link them.</p><p>First, let’s drag and drop our model to xcode and define model property.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/68ec8c78c77c9b60df7a9b400f347a13/href">https://medium.com/media/68ec8c78c77c9b60df7a9b400f347a13/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ebf7e4140e23fe448e67c02c80cc9d6/href">https://medium.com/media/7ebf7e4140e23fe448e67c02c80cc9d6/href</a></iframe><p>(1): Prediction method that returns result if it can find. These params are features that selected on CreateML. I know it looks long and bad but we need all points.</p><p>(2): We call main thread to update ui</p><p>(3):We got wrist point and converted previewLayer frame to show real hand location</p><p>(4):We put the real icon to screen. This part mismatch to topic so i didn’t explain but i added all code on github</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8aab012f2fbe9c4057b3261495c06cfa/href">https://medium.com/media/8aab012f2fbe9c4057b3261495c06cfa/href</a></iframe><p>Finally, we called this method from captureOutput and time to run 🎉💃🏻🕺🏻</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*KolvEWDxeU48DEnSarJOeg.gif" /></figure><p><em>Source Code: </em><a href="https://github.com/oznurAkgun/coreml-hand-detection">https://github.com/oznurAkgun/coreml-hand-detection</a></p><p><em>If you have question or feedback please feel free to write me; </em><a href="https://www.linkedin.com/in/oznurakgun/">Linkedin</a> , <a href="https://twitter.com/oznurakgun_">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e15d11e008bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>