Create ML

RSS for tag

Create machine learning models for use in your app using Create ML.

Posts under Create ML tag

200 Posts

Post

Replies

Boosts

Views

Activity

Problem mit text classifier model
Hi, ich habe nach folgender Anleitung versucht ein Text classifier model zu machen.Allerdings scheitert dies daran, das die evaluation() Funktion nicht funktioniert.Den Error den ich (in SwiftPlayground) bekomme ist: No exact matches in call to instance method 'evaluation' Hier ist der Code, den ich verwende: if #available(iOSApplicationExtension 15.0, *) {         let data = try! MLDataTable(contentsOf:  fileLiteral(resourceName: "TestData.json"))          let (trainingData, testingData) = data.randomSplit(by: 0.8, seed: 5)                  let sentimentClassifier = try! MLTextClassifier(trainingData: trainingData,                                                        textColumn: "text",                                                        labelColumn: "label")         // Training accuracy as a percentage         let trainingAccuracy = (1.0 - sentimentClassifier.trainingMetrics.classificationError) * 100         // Validation accuracy as a percentage         let validationAccuracy = (1.0 - sentimentClassifier.validationMetrics.classificationError) * 100         let evaluationMetrics = sentimentClassifier.evaluation(on: testingData)//Error hier         let evaluationAccuracy = (1.0 - evaluationMetrics.classificationError) * 100                  let metadata = MLModelMetadata(author: "No One",                                        shortDescription: "A model trained to classify movie review sentiment",                                        version: "1.0")         try! sentimentClassifier.write(to: URL(fileURLWithPath: Bundle.main.path(forResource: "MODEL", ofType: "mlmodel")!),                                       metadata: metadata)     } else {         print("dein Gerät erfüllt nicht die Bedingungen für dieses Programm")     } vielen Dank im Voraus (:
1
0
1.9k
Mar ’23
Adding custom Create ML model into Create ML Components pipeline
I have been reading up on the new Create ML Components documentation, mostly the sample code for 'Counting Human Counting human body action repetitions in a live video feed', which can be found here. I currently have a body action classifier model built with UIKit/SwiftUI front-end and a relatively complex back-end, but this solution looks far more clean and is 100% SwiftUI - which is a big plus for me. Based on this sample code and documentation, how would I use my own body action classifier with this sample code? Purely interested and amazed by how lightweight it is and would love to see how a CreateML model could be implemented here.
3
0
1.6k
Mar ’23
ML Model Shows Wrong output or predictions
Hi, I am trying to implement shape classification or drawing classification in swift playgrounds app. It basically has a Image classifier which is trained on different hand drawn shapes and once the user stops drawing on the canvas the ML model is called to predict the shape but I am getting poor results while running the app in Xcode but when I try the predict the same image with the create ML preview tab the model works perfectly fine. I tried to convert the image to cvPixelBuffer with the specific parameters given by the model such as Input image to be classified as color (kCVPixelFormatType_32BGRA) image buffer, 299 pixels wide by 299 pixels high So what could be the Issue, I even tried to use Vision but I didn't work too. Any help would be appreciated. Thanks. Sanjiv A
1
0
1.3k
Mar ’23
Detecting malware through Machine Learning
Hello, I wanted to hear some opinions on this problem I want to tackle. Currently at my job we have an Endpoint Security sysext app (swift) deployed on 10k+ macs and we are using a custom rule engine we developed to run some rules on the events received by the app. These rules are downloaded by the app. This works great but we wanted to dive into the world of ML and try to use it to detect more complex malware that may be more difficult to detect using rules. We thought of two options to approach this: Periodically collect events from all macs and send them to an api to be stored somewhere and perform the training in the cloud. Somehow, maybe using the ML frameworks provided in Swift, train the model IN the device rather than in the cloud. I know this is a very broad question but I just wanted to hear some suggestions. Thanks in advance.
2
0
1.4k
Mar ’23
Evaluating image recognition models and obtaining preview results
I am training an image recognition model in CreateML. The model is ready, but I would like to have the data displayed in the evaluation view and preview in a CSV file. using the CSV file, I would like to identify the image files that have contributed to the accuracy of the model as a result of the training. I have searched the documentation but could not find a solution. If anyone knows of a solution, please let me know.
1
0
620
Jan ’23
Evaluating image recognition models and obtaining preview results
I am training an image recognition model in CreateML. The model is ready, but I would like to have the data displayed in the evaluation view and preview in a CSV file. using the CSV file, I would like to identify the image files that have contributed to the accuracy of the model as a result of the training. I have searched the documentation but could not find a solution. If anyone knows of a solution, please let me know.
0
0
622
Jan ’23
ValueError: Shape of the RGB/BGR image output, 'colorOutput', must be of kind (1, 3, H, W), i.e., first two dimensions must be (1, 3), instead they are: (1, 2)
I specifically give the model the shape of (1, 3, 1024, 1024), but for some reason, CoreML thinks it's 2 channels instead of 3. The pytorch model is based on this - LINK The "local.pth" model to be specific. My CoreML conversion code is attached below. #from networks.drn_seg import DRNSeg import coremltools as ct import coremltools.proto.FeatureTypes_pb2 as ft import io from PIL import Image from torchvision import transforms import math import torch import torch.nn as nn from networks.drn import drn_c_26 import torchvision from torchvision.io import read_image def fill_up_weights(up): w = up.weight.data f = math.ceil(w.size(2) / 2) c = (2 * f - 1 - f % 2) / (2. * f) for i in range(w.size(2)): for j in range(w.size(3)): w[0, 0, i, j] = \ (1 - math.fabs(i / f - c)) * (1 - math.fabs(j / f - c)) for c in range(1, w.size(0)): w[c, 0, :, :] = w[0, 0, :, :] class DRNSeg(nn.Module): def __init__(self): super(DRNSeg, self).__init__() classes=2 pretrained_drn=None pretrained_model=None use_torch_up=False model = drn_c_26(pretrained=pretrained_drn) self.base = nn.Sequential(*list(model.children())[:-2]) if pretrained_model: self.load_pretrained(pretrained_model) self.seg = nn.Conv2d(model.out_dim, classes, kernel_size=1, bias=True) m = self.seg n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels m.weight.data.normal_(0, math.sqrt(2. / n)) m.bias.data.zero_() if use_torch_up: self.up = nn.UpsamplingBilinear2d(scale_factor=8) else: up = nn.ConvTranspose2d(classes, classes, 16, stride=8, padding=4, output_padding=0, groups=classes, bias=False) fill_up_weights(up) up.weight.requires_grad = False self.up = up def forward(self, x): x = self.base(x) x = self.seg(x) y = self.up(x) return y def optim_parameters(self, memo=None): for param in self.base.parameters(): yield param for param in self.seg.parameters(): yield param def load_pretrained(self, pretrained_model): print("loading the pretrained drn model from %s" % pretrained_model) state_dict = torch.load(pretrained_model, map_location='cpu') if hasattr(state_dict, '_metadata'): del state_dict._metadata # filter out unnecessary keys pretrained_dict = state_dict['model'] pretrained_dict = {k[5:]: v for k, v in pretrained_dict.items() if k.split('.')[0] == 'base'} # load the pretrained state dict self.base.load_state_dict(pretrained_dict) #img = read_image('test.jpg') model_path = ("modelphotoshop.pth") device = 'cpu' model_flow = DRNSeg() model_flow.load_state_dict(torch.load(model_path, map_location=device)) model_flow.to(device) model_flow.eval() example_input = torch.randn([1,3,1024,1024]) traced_model = torch.jit.trace(model_flow, example_input) traced_model.save("modelphotoshop.pt") shape = (1,3, 1024, 1024) mlmodel = ct.convert(traced_model, convert_to="mlprogram", inputs=[ct.ImageType(name="colorImage", shape=shape, color_layout=ct.colorlayout.RGB,)], outputs=[ct.ImageType(name="colorOutput", color_layout=ct.colorlayout.RGB,)], ) mlmodel.save("Model.mlmodel")
2
0
1.2k
Jan ’23
Core ML: Strong increase in load time with quantisation from 16 to 8 bits
Hi, I have a BERT-large model that has been quantised to 16 bits. According to the performance report, the model takes about 500 ms to load: If I quantise the model further to 8 bits, the loading time increases drastically to almost 2500 ms. That is a fivefold increase: Does anyone have an explanation for this? I would rather have expected a reduction in the loading time, since the model is only half as large due to the further quantisation. I have carried out the measurements several times and always come to the same result. My only idea is that it might be due to the compute precision, which is limited to 16 bits in the CPU, GPU and NPU.
0
0
1.1k
Jan ’23
FullyConnectedNetworkRegressor activation functions
Hi, I am using FullyConnectedNetworkRegressor to build an ML pipeline. The FullyConnectedNetworkConfiguration allows one to specify hiddenUnitCounts for the hidden layers, but I don't see any way to specify or get the activation function for the hidden layers. Is there a way to specify the activation function for the hidden layers? If not, does anyone know what activation function is used for the hidden layers or how they are determined? Thanks, Tom
2
0
885
Jan ’23
CreateML image extraction ends in `Unexpected error`, opens `Create New Project` window
I'm trying to train an image classification model in CreateML application using the DF20 dataset from https://sites.google.com/view/danish-fungi-dataset?pli=1 When I tap on Train, the application begins to extract the necessary data. This process ends after the first cca 30 000 images. The footer shows Unexpected error and (strangely) a new window opens to Create New Project. No further info about the error is provided anywhere. The training succeeds when using a smaller portion of the dataset (<20 000 images). Anything over 40 000 images results in this error. Any ideas?
1
0
1.3k
Jan ’23
How can I create a multi-input model using CreateML?
Let's say I would like to build a classification model to recognise plants. Two plants may look identical but differ by region or month of growth, so I would like to build a multi-input model that accepts not only an image, but also additional metadata, such as the month and location where the photo was taken. Inputs: imageOfPlant: Image month: Double latitude: Double longitude: Double Output: speciesName: [String] // sorted by probability, like default image classification Can this be done in CreateML, or using Apple frameworks in general?
1
0
1.2k
Jan ’23
Unexpected error every time I upload images to Create ML
I'm new to create ML and I have downloaded Xcode and then I open Create ML. I'm using my mac book pro with OS Monterey. Version of Xcode = 14.2 Version of Create ML = 4.0 I simply open a new project and choose image classification. I then save the project and then choose the set of image that I want to train. As soon as I drag and drop the image folder in Training data box I get an unexpected error message. I even restarted my macbook and restarted XCode and CreateML. I have tried everything from people discussing online about the image size and types and even used online available set of images but I still get the same unexpected error message. Can anyone please help me with this one. Regards Lutfi
0
0
898
Dec ’22
No such module “CreateMLUI” xCode 12.4 Big Sure 11.1
I have trouble with importing CreateMLUI in the PlayGround. What I have tried: – Creating Mac OS blank playground – Restarting Xcode more than 5 times – Removing all the other boilerplate code – Reinstalling xCode completely – Checking PlayGround Settings platform But anyway the same: No such module “CreateMLUI” How to import this thing? Any suggestions?
4
0
5.4k
Dec ’22
Object detection for dice not working
Hi from France ! I'm trying to create a model for dice detection. I've take about 100 photos of dice on the same side (1 point). Are-my bounding boxes good ? should I take the whole dice ? I launched the trainning, it seems to work well : Then in the Evaluation tab, the values seems not great but not bad : I/U 84% Varied I/U 44% The validation scope is very low : In the preview tab, no matter what image I give to it, I have no detection What am I missing ? What should I improve ?
3
1
2.0k
Dec ’22
Missing required column 'label' in json. at "HandPoseAssests.json"
I have created the .json file according to the https://developer.apple.com/documentation/createml/building-an-object-detector-data-source here is my .json file below     {         "imagefilename":"Five Fingers.HEIC",         "annotation": [             {                 "coordinates": {                     "y": 156.062,                     "x": 195.122,                     "height": 148.872,                     "width": 148.03                 },                 "label": "Five Fingers"             }         ]     },     {         "imagefilename": "One Finger.HEIC",         "annotation": [             {                 "coordinates": {                     "y": 156.062,                     "x": 195.122,                     "height": 148.872,                     "width": 148.03                 },                 "label": "One Finger"             }         ]     },     {         "imagefilename": "Two Finger.HEIC",         "annotation": [             {                 "coordinates": {                     "y": 156.062,                     "x": 195.122,                     "height": 148.872,                     "width": 148.03                 },                 "label": "Two Finger"             }         ]     },     {         "imagefilename": "Four Finger.HEIC",         "annotation": [             {                 "coordinates": {                     "y": 156.062,                     "x": 195.122,                     "height": 148.872,                     "width": 148.03                 },                 "label": "Four Finger"             }         ]     }     ] but it shows error as Missing required column 'label' in json. at "NameOfJsonFile.json" Were am I Wrong
2
0
1.5k
Dec ’22
Help wanted with how to train a model
Hey there, I am new to developing in the Apple ecosystem, as well as a novice in the field of ML. I have dabbled a little bit in ML with face recognition in Python, but that's about it. The thing I've found is that there is quite a lot of training algorithms and such for computer vision related things, but for my use case I don't really know what I am looking for, from a ML perspective. Thing is, I have real time telemetry data where I have to determine the CURRENT (or near-current) state based on historic data (from NOW and BACKWARDS for 0 to something like 20 seconds, or more). The initial state is pretty easy to determine based on a few values, basically a UInt16 is set to 65535. Most of the possible states can be determined over time from the telemetry, but there are certain cases that can vary quite a lot. These cases are very likely possible to pick up as a human examining the logs, but it's something that seems hard or impossible to create a programmatic logic around. The sample rate in real time is pretty steady at 60 Hz. Basically, I'm curious about what kind of ML model would be suitable to train around this kind of data, and how? Generally, it shouldn't be a huge problem creating the training data. Even if it takes a while to manually mark up the various state changes, it is far from infeasible. Much of the data will differ wildly from dataset to dataset, while some will be very similar from one dataset to another. So, basically I would need a model that can take several datasets of telemetry data (including when the state changes), run it through the ML to train a model that can, using real time data for the last 0-10 seconds or so, determine what state we're in at the moment. In most cases it can even have a "delay" of a second or so. The state change itself is not time critical as such, but it should be able to determine state with a very high confidence as possible within the space of at most 3 seconds. As I understand it the Create ML app can be used for training a model, for use with the app in question. But as mentioned, I have no real idea what is most suitable for training a model with this kind of data that is supposed to analyze data over time. Tabular Regression, Recommendation? Something else entirely? I'm guessing that real time data in production code would be supplied as a dataset with the last 20-30 seconds of data as input to the model, rather than just the last packet of telemetry data. But this is just my assumption. I am attaching a text file with comma separated values from sample telemetry, somewhat truncated for brevity. There are a variety of fields, including coordinates in XYZ space, which have some relation to the state, but can vary wildly from one dataset to another (depending on location). But I assume that the training would automatically give those fields less weight? If anyone can point me in the right direction, I would be really grateful. The finished model will eventually be used in an iOS app that will display the real time telemetry data. Thanks in advance, /Peter sample-telemetry.txt
2
0
1.8k
Dec ’22
How to get labels from object detection CoreML
Hi there, I train an object detection model in CreateML and want to deploy in Python. Then I can get coordination from the following codes but how to get the labels of prediction? import coremltools as ct from PIL import Image path = '/sample.jpeg' example_image = Image.open(path).resize((960, 128)) model_path = '/sample.mlmodel' model = ct.models.MLModel(model_path) out_dict = model.predict({'imagePath': example_image,}) out_dict
1
0
1.5k
Nov ’22
Problem mit text classifier model
Hi, ich habe nach folgender Anleitung versucht ein Text classifier model zu machen.Allerdings scheitert dies daran, das die evaluation() Funktion nicht funktioniert.Den Error den ich (in SwiftPlayground) bekomme ist: No exact matches in call to instance method 'evaluation' Hier ist der Code, den ich verwende: if #available(iOSApplicationExtension 15.0, *) {         let data = try! MLDataTable(contentsOf:  fileLiteral(resourceName: "TestData.json"))          let (trainingData, testingData) = data.randomSplit(by: 0.8, seed: 5)                  let sentimentClassifier = try! MLTextClassifier(trainingData: trainingData,                                                        textColumn: "text",                                                        labelColumn: "label")         // Training accuracy as a percentage         let trainingAccuracy = (1.0 - sentimentClassifier.trainingMetrics.classificationError) * 100         // Validation accuracy as a percentage         let validationAccuracy = (1.0 - sentimentClassifier.validationMetrics.classificationError) * 100         let evaluationMetrics = sentimentClassifier.evaluation(on: testingData)//Error hier         let evaluationAccuracy = (1.0 - evaluationMetrics.classificationError) * 100                  let metadata = MLModelMetadata(author: "No One",                                        shortDescription: "A model trained to classify movie review sentiment",                                        version: "1.0")         try! sentimentClassifier.write(to: URL(fileURLWithPath: Bundle.main.path(forResource: "MODEL", ofType: "mlmodel")!),                                       metadata: metadata)     } else {         print("dein Gerät erfüllt nicht die Bedingungen für dieses Programm")     } vielen Dank im Voraus (:
Replies
1
Boosts
0
Views
1.9k
Activity
Mar ’23
Adding custom Create ML model into Create ML Components pipeline
I have been reading up on the new Create ML Components documentation, mostly the sample code for 'Counting Human Counting human body action repetitions in a live video feed', which can be found here. I currently have a body action classifier model built with UIKit/SwiftUI front-end and a relatively complex back-end, but this solution looks far more clean and is 100% SwiftUI - which is a big plus for me. Based on this sample code and documentation, how would I use my own body action classifier with this sample code? Purely interested and amazed by how lightweight it is and would love to see how a CreateML model could be implemented here.
Replies
3
Boosts
0
Views
1.6k
Activity
Mar ’23
Can HumanBodyActionCounter counts hand action??
I was trying to hand action repetition though HumanBodyActionCounter but seems like its not working. So does HumanBodyActionCounter counts hand action also?
Replies
2
Boosts
0
Views
1.3k
Activity
Mar ’23
ML Model Shows Wrong output or predictions
Hi, I am trying to implement shape classification or drawing classification in swift playgrounds app. It basically has a Image classifier which is trained on different hand drawn shapes and once the user stops drawing on the canvas the ML model is called to predict the shape but I am getting poor results while running the app in Xcode but when I try the predict the same image with the create ML preview tab the model works perfectly fine. I tried to convert the image to cvPixelBuffer with the specific parameters given by the model such as Input image to be classified as color (kCVPixelFormatType_32BGRA) image buffer, 299 pixels wide by 299 pixels high So what could be the Issue, I even tried to use Vision but I didn't work too. Any help would be appreciated. Thanks. Sanjiv A
Replies
1
Boosts
0
Views
1.3k
Activity
Mar ’23
Detecting malware through Machine Learning
Hello, I wanted to hear some opinions on this problem I want to tackle. Currently at my job we have an Endpoint Security sysext app (swift) deployed on 10k+ macs and we are using a custom rule engine we developed to run some rules on the events received by the app. These rules are downloaded by the app. This works great but we wanted to dive into the world of ML and try to use it to detect more complex malware that may be more difficult to detect using rules. We thought of two options to approach this: Periodically collect events from all macs and send them to an api to be stored somewhere and perform the training in the cloud. Somehow, maybe using the ML frameworks provided in Swift, train the model IN the device rather than in the cloud. I know this is a very broad question but I just wanted to hear some suggestions. Thanks in advance.
Replies
2
Boosts
0
Views
1.4k
Activity
Mar ’23
Evaluating image recognition models and obtaining preview results
I am training an image recognition model in CreateML. The model is ready, but I would like to have the data displayed in the evaluation view and preview in a CSV file. using the CSV file, I would like to identify the image files that have contributed to the accuracy of the model as a result of the training. I have searched the documentation but could not find a solution. If anyone knows of a solution, please let me know.
Replies
1
Boosts
0
Views
620
Activity
Jan ’23
Evaluating image recognition models and obtaining preview results
I am training an image recognition model in CreateML. The model is ready, but I would like to have the data displayed in the evaluation view and preview in a CSV file. using the CSV file, I would like to identify the image files that have contributed to the accuracy of the model as a result of the training. I have searched the documentation but could not find a solution. If anyone knows of a solution, please let me know.
Replies
0
Boosts
0
Views
622
Activity
Jan ’23
ValueError: Shape of the RGB/BGR image output, 'colorOutput', must be of kind (1, 3, H, W), i.e., first two dimensions must be (1, 3), instead they are: (1, 2)
I specifically give the model the shape of (1, 3, 1024, 1024), but for some reason, CoreML thinks it's 2 channels instead of 3. The pytorch model is based on this - LINK The "local.pth" model to be specific. My CoreML conversion code is attached below. #from networks.drn_seg import DRNSeg import coremltools as ct import coremltools.proto.FeatureTypes_pb2 as ft import io from PIL import Image from torchvision import transforms import math import torch import torch.nn as nn from networks.drn import drn_c_26 import torchvision from torchvision.io import read_image def fill_up_weights(up): w = up.weight.data f = math.ceil(w.size(2) / 2) c = (2 * f - 1 - f % 2) / (2. * f) for i in range(w.size(2)): for j in range(w.size(3)): w[0, 0, i, j] = \ (1 - math.fabs(i / f - c)) * (1 - math.fabs(j / f - c)) for c in range(1, w.size(0)): w[c, 0, :, :] = w[0, 0, :, :] class DRNSeg(nn.Module): def __init__(self): super(DRNSeg, self).__init__() classes=2 pretrained_drn=None pretrained_model=None use_torch_up=False model = drn_c_26(pretrained=pretrained_drn) self.base = nn.Sequential(*list(model.children())[:-2]) if pretrained_model: self.load_pretrained(pretrained_model) self.seg = nn.Conv2d(model.out_dim, classes, kernel_size=1, bias=True) m = self.seg n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels m.weight.data.normal_(0, math.sqrt(2. / n)) m.bias.data.zero_() if use_torch_up: self.up = nn.UpsamplingBilinear2d(scale_factor=8) else: up = nn.ConvTranspose2d(classes, classes, 16, stride=8, padding=4, output_padding=0, groups=classes, bias=False) fill_up_weights(up) up.weight.requires_grad = False self.up = up def forward(self, x): x = self.base(x) x = self.seg(x) y = self.up(x) return y def optim_parameters(self, memo=None): for param in self.base.parameters(): yield param for param in self.seg.parameters(): yield param def load_pretrained(self, pretrained_model): print("loading the pretrained drn model from %s" % pretrained_model) state_dict = torch.load(pretrained_model, map_location='cpu') if hasattr(state_dict, '_metadata'): del state_dict._metadata # filter out unnecessary keys pretrained_dict = state_dict['model'] pretrained_dict = {k[5:]: v for k, v in pretrained_dict.items() if k.split('.')[0] == 'base'} # load the pretrained state dict self.base.load_state_dict(pretrained_dict) #img = read_image('test.jpg') model_path = ("modelphotoshop.pth") device = 'cpu' model_flow = DRNSeg() model_flow.load_state_dict(torch.load(model_path, map_location=device)) model_flow.to(device) model_flow.eval() example_input = torch.randn([1,3,1024,1024]) traced_model = torch.jit.trace(model_flow, example_input) traced_model.save("modelphotoshop.pt") shape = (1,3, 1024, 1024) mlmodel = ct.convert(traced_model, convert_to="mlprogram", inputs=[ct.ImageType(name="colorImage", shape=shape, color_layout=ct.colorlayout.RGB,)], outputs=[ct.ImageType(name="colorOutput", color_layout=ct.colorlayout.RGB,)], ) mlmodel.save("Model.mlmodel")
Replies
2
Boosts
0
Views
1.2k
Activity
Jan ’23
Core ML: Strong increase in load time with quantisation from 16 to 8 bits
Hi, I have a BERT-large model that has been quantised to 16 bits. According to the performance report, the model takes about 500 ms to load: If I quantise the model further to 8 bits, the loading time increases drastically to almost 2500 ms. That is a fivefold increase: Does anyone have an explanation for this? I would rather have expected a reduction in the loading time, since the model is only half as large due to the further quantisation. I have carried out the measurements several times and always come to the same result. My only idea is that it might be due to the compute precision, which is limited to 16 bits in the CPU, GPU and NPU.
Replies
0
Boosts
0
Views
1.1k
Activity
Jan ’23
Activity Classifier Data
How can I gather data from a watch for an activity classifier model? Are there any tools to help facilitate this?
Replies
1
Boosts
1
Views
1.1k
Activity
Jan ’23
FullyConnectedNetworkRegressor activation functions
Hi, I am using FullyConnectedNetworkRegressor to build an ML pipeline. The FullyConnectedNetworkConfiguration allows one to specify hiddenUnitCounts for the hidden layers, but I don't see any way to specify or get the activation function for the hidden layers. Is there a way to specify the activation function for the hidden layers? If not, does anyone know what activation function is used for the hidden layers or how they are determined? Thanks, Tom
Replies
2
Boosts
0
Views
885
Activity
Jan ’23
CreateML image extraction ends in `Unexpected error`, opens `Create New Project` window
I'm trying to train an image classification model in CreateML application using the DF20 dataset from https://sites.google.com/view/danish-fungi-dataset?pli=1 When I tap on Train, the application begins to extract the necessary data. This process ends after the first cca 30 000 images. The footer shows Unexpected error and (strangely) a new window opens to Create New Project. No further info about the error is provided anywhere. The training succeeds when using a smaller portion of the dataset (<20 000 images). Anything over 40 000 images results in this error. Any ideas?
Replies
1
Boosts
0
Views
1.3k
Activity
Jan ’23
How can I create a multi-input model using CreateML?
Let's say I would like to build a classification model to recognise plants. Two plants may look identical but differ by region or month of growth, so I would like to build a multi-input model that accepts not only an image, but also additional metadata, such as the month and location where the photo was taken. Inputs: imageOfPlant: Image month: Double latitude: Double longitude: Double Output: speciesName: [String] // sorted by probability, like default image classification Can this be done in CreateML, or using Apple frameworks in general?
Replies
1
Boosts
0
Views
1.2k
Activity
Jan ’23
Unexpected error every time I upload images to Create ML
I'm new to create ML and I have downloaded Xcode and then I open Create ML. I'm using my mac book pro with OS Monterey. Version of Xcode = 14.2 Version of Create ML = 4.0 I simply open a new project and choose image classification. I then save the project and then choose the set of image that I want to train. As soon as I drag and drop the image folder in Training data box I get an unexpected error message. I even restarted my macbook and restarted XCode and CreateML. I have tried everything from people discussing online about the image size and types and even used online available set of images but I still get the same unexpected error message. Can anyone please help me with this one. Regards Lutfi
Replies
0
Boosts
0
Views
898
Activity
Dec ’22
No such module “CreateMLUI” xCode 12.4 Big Sure 11.1
I have trouble with importing CreateMLUI in the PlayGround. What I have tried: – Creating Mac OS blank playground – Restarting Xcode more than 5 times – Removing all the other boilerplate code – Reinstalling xCode completely – Checking PlayGround Settings platform But anyway the same: No such module “CreateMLUI” How to import this thing? Any suggestions?
Replies
4
Boosts
0
Views
5.4k
Activity
Dec ’22
Object detection for dice not working
Hi from France ! I'm trying to create a model for dice detection. I've take about 100 photos of dice on the same side (1 point). Are-my bounding boxes good ? should I take the whole dice ? I launched the trainning, it seems to work well : Then in the Evaluation tab, the values seems not great but not bad : I/U 84% Varied I/U 44% The validation scope is very low : In the preview tab, no matter what image I give to it, I have no detection What am I missing ? What should I improve ?
Replies
3
Boosts
1
Views
2.0k
Activity
Dec ’22
Missing required column 'label' in json. at "HandPoseAssests.json"
I have created the .json file according to the https://developer.apple.com/documentation/createml/building-an-object-detector-data-source here is my .json file below     {         "imagefilename":"Five Fingers.HEIC",         "annotation": [             {                 "coordinates": {                     "y": 156.062,                     "x": 195.122,                     "height": 148.872,                     "width": 148.03                 },                 "label": "Five Fingers"             }         ]     },     {         "imagefilename": "One Finger.HEIC",         "annotation": [             {                 "coordinates": {                     "y": 156.062,                     "x": 195.122,                     "height": 148.872,                     "width": 148.03                 },                 "label": "One Finger"             }         ]     },     {         "imagefilename": "Two Finger.HEIC",         "annotation": [             {                 "coordinates": {                     "y": 156.062,                     "x": 195.122,                     "height": 148.872,                     "width": 148.03                 },                 "label": "Two Finger"             }         ]     },     {         "imagefilename": "Four Finger.HEIC",         "annotation": [             {                 "coordinates": {                     "y": 156.062,                     "x": 195.122,                     "height": 148.872,                     "width": 148.03                 },                 "label": "Four Finger"             }         ]     }     ] but it shows error as Missing required column 'label' in json. at "NameOfJsonFile.json" Were am I Wrong
Replies
2
Boosts
0
Views
1.5k
Activity
Dec ’22
Help wanted with how to train a model
Hey there, I am new to developing in the Apple ecosystem, as well as a novice in the field of ML. I have dabbled a little bit in ML with face recognition in Python, but that's about it. The thing I've found is that there is quite a lot of training algorithms and such for computer vision related things, but for my use case I don't really know what I am looking for, from a ML perspective. Thing is, I have real time telemetry data where I have to determine the CURRENT (or near-current) state based on historic data (from NOW and BACKWARDS for 0 to something like 20 seconds, or more). The initial state is pretty easy to determine based on a few values, basically a UInt16 is set to 65535. Most of the possible states can be determined over time from the telemetry, but there are certain cases that can vary quite a lot. These cases are very likely possible to pick up as a human examining the logs, but it's something that seems hard or impossible to create a programmatic logic around. The sample rate in real time is pretty steady at 60 Hz. Basically, I'm curious about what kind of ML model would be suitable to train around this kind of data, and how? Generally, it shouldn't be a huge problem creating the training data. Even if it takes a while to manually mark up the various state changes, it is far from infeasible. Much of the data will differ wildly from dataset to dataset, while some will be very similar from one dataset to another. So, basically I would need a model that can take several datasets of telemetry data (including when the state changes), run it through the ML to train a model that can, using real time data for the last 0-10 seconds or so, determine what state we're in at the moment. In most cases it can even have a "delay" of a second or so. The state change itself is not time critical as such, but it should be able to determine state with a very high confidence as possible within the space of at most 3 seconds. As I understand it the Create ML app can be used for training a model, for use with the app in question. But as mentioned, I have no real idea what is most suitable for training a model with this kind of data that is supposed to analyze data over time. Tabular Regression, Recommendation? Something else entirely? I'm guessing that real time data in production code would be supplied as a dataset with the last 20-30 seconds of data as input to the model, rather than just the last packet of telemetry data. But this is just my assumption. I am attaching a text file with comma separated values from sample telemetry, somewhat truncated for brevity. There are a variety of fields, including coordinates in XYZ space, which have some relation to the state, but can vary wildly from one dataset to another (depending on location). But I assume that the training would automatically give those fields less weight? If anyone can point me in the right direction, I would be really grateful. The finished model will eventually be used in an iOS app that will display the real time telemetry data. Thanks in advance, /Peter sample-telemetry.txt
Replies
2
Boosts
0
Views
1.8k
Activity
Dec ’22
Online Json converter for Object detection for ML app
Is there any online tool to convert the images to json file for annotation from image exceptionally made for ML app
Replies
4
Boosts
0
Views
1.7k
Activity
Nov ’22
How to get labels from object detection CoreML
Hi there, I train an object detection model in CreateML and want to deploy in Python. Then I can get coordination from the following codes but how to get the labels of prediction? import coremltools as ct from PIL import Image path = '/sample.jpeg' example_image = Image.open(path).resize((960, 128)) model_path = '/sample.mlmodel' model = ct.models.MLModel(model_path) out_dict = model.predict({'imagePath': example_image,}) out_dict
Replies
1
Boosts
0
Views
1.5k
Activity
Nov ’22