<?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 MarioSenatore on Medium]]></title>
        <description><![CDATA[Stories by MarioSenatore on Medium]]></description>
        <link>https://medium.com/@mariosenatore21?source=rss-ea7e39446748------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*g9mHFyYmK3NGhtpI2yBMHw.png</url>
            <title>Stories by MarioSenatore on Medium</title>
            <link>https://medium.com/@mariosenatore21?source=rss-ea7e39446748------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 01:55:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mariosenatore21/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[Real Time Camera Object Detection using CoreML with UIKIT]]></title>
            <link>https://medium.com/@mariosenatore21/real-time-camera-object-detection-using-coreml-98c17a5f3764?source=rss-ea7e39446748------2</link>
            <guid isPermaLink="false">https://medium.com/p/98c17a5f3764</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[uikit]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[coreml]]></category>
            <dc:creator><![CDATA[MarioSenatore]]></dc:creator>
            <pubDate>Thu, 24 Mar 2022 18:31:28 GMT</pubDate>
            <atom:updated>2022-04-06T14:50:51.130Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*kM9mSi54qOaFK7OsdIV9ZQ.jpeg" /></figure><p>A simple app for beginners who want to understand how to create a real-time object detection with CoreML and other apple frameworks used for machine learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/176/1*wB6nQIQ2TN_6ySjYFauTXw.gif" /></figure><h4><strong>Frameworks &amp; Model used:</strong></h4><blockquote>-UIKIT<br>-CoreML<br>-Vision<br>-AVKit<br>-Resnet50 (provided by Apple)</blockquote><p>Let’s start to create a single View application that will show you the camera frame and inside a label with the detected object description and how much accurate is the prediction.</p><p>The first thing to do is to <strong>set up live capture</strong>, so that we can analyze the image that is coming in through the camera.</p><p>let’s import AVKit and then configure AVCaptureSession in this way:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e5a2ba9779588f6dc18207698bc704d/href">https://medium.com/media/0e5a2ba9779588f6dc18207698bc704d/href</a></iframe><p>Once configured <strong>AVCaptureSession</strong>, we have to start the session with a <strong>capture.StartRunning()</strong> but if we try to run it, at the moment, nothing will happen because we haven’t assigned yet any kind of capture input device for the capture session.</p><blockquote>Before doing that make sure that you ask for camera permission in the Info.plist, by providing<strong> Privacy — Camera Usage Description</strong></blockquote><p>Let’s add the input Device:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2cb7c0c64c7396fcd63f3c6b0c8a00e4/href">https://medium.com/media/2cb7c0c64c7396fcd63f3c6b0c8a00e4/href</a></iframe><p>Finally, the app will run, but <strong>we still don’t have the camera output</strong> cause we haven’t told the app to give us the output, so let’s do that!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d9ef4e3d12ac48f1130e681ad8415fb4/href">https://medium.com/media/d9ef4e3d12ac48f1130e681ad8415fb4/href</a></iframe><p>Now we are finally able to see what the device is seeing.</p><p>Another thing to add <strong>is the access to cameras frame layer</strong> so the way to do that is to add an output monitor in this way:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5ba8aa4086d4c1c3a25ae22d5e215588/href">https://medium.com/media/5ba8aa4086d4c1c3a25ae22d5e215588/href</a></iframe><p>The final step is to <strong>add a delegate method </strong>whenever a frame is being captured:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f06117353c64748f6ba27830cb7a2c36/href">https://medium.com/media/f06117353c64748f6ba27830cb7a2c36/href</a></iframe><p>Before testing project:</p><p><strong>download</strong> and <strong>add</strong> the model inside your Xcode project folder.</p><p><strong>Model link </strong>: <a href="https://developer.apple.com/machine-learning/models/">https://developer.apple.com/machine-learning/models/</a></p><p><strong>Full Code</strong> : <a href="https://github.com/mariosenatore21/LiveDetector.git">https://github.com/mariosenatore21/LiveDetector.git</a></p><p><strong>LinkedIn</strong> : <a href="https://www.linkedin.com/in/mario-senatore-78a061149/">https://www.linkedin.com/in/mario-senatore-78a061149/</a></p><p>*Model is not 100% accurate as you can see, I suggest you to train your own personal model or simply use another one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98c17a5f3764" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>