is there an apple products images .mlmodel ?

Hi, I was wondering if there's a pre-trained .mlmodel that is able to identify apple products.

It will be useful to identify the iPhone/iPad/Mac using that model


Regards

Replies

No, there is not.


And you would never use a machine learning model to determine the type of device the app is running on, it is unnecessary.


Instead you can use the following code to get the device identifier (credit to stackoverflow):


var systemInfo = utsname() 
uname(&systemInfo) 
let machineMirror = Mirror(reflecting: systemInfo.machine) 
let identifier = machineMirror.children.reduce("") { identifier, element in 
     guard let value = element.value as? Int8, value != 0 else { return identifier } 
     return identifier + String(UnicodeScalar(UInt8(value))) 
}


The 'identifier' variable will be a string, such as 'iPhone7,1' for the iPhone 6 Plus, and so on.


The only time I have ever used such code is when I want to add some feature to an app that is simply too computationally expensive to be performed on some old iPhone model, so I used this code to restrict those particular older models to some less expensive version of that feature. You do NOT want to use this code to configure your UI, use autolayout.


But if you are talking about a machine learning model to be able to visually tell from an image what type of device it is, then yes, you could certainly accomplish that with a machine learning model. There is plenty of data out there showing images of iOS devices in various situations you could use to train your model but I am not aware of any pre-existing databases of these images.