Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Python is an interpreted, high-level and general-purpose programming language. Python was created in the late 1980s, and first released in 1991, by Guido van Rossum as a successor to the ABC programming language. Mainly Python used for machine learning in data science.
Apple doesn’t support Python directly. TensorFlow provides a next-generation platform for machine learning. TensorFlow provides the framework to Implement interpreted python in ios both Swift & Objective-C. Please visit the TensorFlow website to know more about this framework.
In this blog, I will show you how can match 2 faces using python. To implement this we need a .tflite file where we have already implement python code and compressed it. I will share my blog to create .tflite from TensorFlow.
Let’s Start
Swift version: 5.2 iOS version: 14 Xcode: 12.0
First Create a project from Xcode.
File ▸ New ▸ Project…. Choose the iOS ▸ Application ▸ Single View App template and create a new project.
Second, add TensorFlowLiteSwift to your project.
Add MobileFace.tflite in your project. This file I will share below.
Now create a class with the name MobileFace.
import TensorFlowLite in this class.
Now add some variable which is used in our class.
Now initialize the Interpreter object.
Add compare method inside our class. Here we will compare 2 images and return compare result.
Now Implement scaleImage method in the class.
Now Normalize and evaluate our result.
This code is enough to compare to face. Now call this compare method.
Output:
Conclusion: We can easily implement Python using swift and it quite easy.
Next blog I will image face detection, crop, and compare using python in swift.
I hope this code will help you better to understand the implementation of Python using swift. If you feel any doubt or query please comment below.
Thank you.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
All communication is done through a ticket system. I appreciate the regular almost daily updates of what is being worked on, and communicating changes or updates is easy through this system. Mobikul's response timeframe is quick.
Josh Arnold
Owner, Shop ATV Escape
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.