Questions tagged [coreml]

Apple's Core ML framework and tools for making predictions using Machine Learning. Supports a variety of regression and classification models, as well as general-purpose neural networks.

Filter by
Sorted by
Tagged with
1 vote
0 answers
28 views

How to solve 'Value of type 'DJIVideoFeed' has no member 'remoteCamera'' error when trying to do real-time object detection with DJI Drone?

I am trying to do real time object detection with DJI Drone. I want to combine the AVCaptureVideo command and the DJISDK video process and show the image and object detection frames on a single layer ...
Faruk Cansız's user avatar
-1 votes
0 answers
29 views

Real Time Object Detection with CoreML Model on DJI Drone's Camera Integrated Into My Mobile App [closed]

I'm a Junior iOS Developer and I developed an application that does real-time object detection based on the CoreML Model. I will bring to imagine the application: You are logging in. There are two ...
Faruk Cansız's user avatar
1 vote
0 answers
24 views

Deprecation Warning Use DataSource instead of MLDataTable when initializing in Create ML

I am running the following code in Xcode 14.3 Playgrounds. I am using macOS Ventura 13.1. let csvFile = Bundle.main.url(forResource: "all-data", withExtension: "csv")! let ...
john doe's user avatar
  • 9,140
-1 votes
2 answers
27 views

Core ML Fetching decryption key from server failed

I have an app with encrypted core ML model. App was working fine and was decrypting model properly. After app update on my device it has started giving following error [coreml] Could not create ...
Amit's user avatar
  • 69
0 votes
0 answers
19 views

CoreMLHelpers : Create binary data of image for multiarray conversion

We are referring this for CoreMLhelpers for below for converting UIImage to MultiArray and vice versa. Link: https://github.com/hollance/CoreMLHelpers. We found below reference of comment. // cat.bin ...
Banng's user avatar
  • 531
0 votes
0 answers
23 views

How to get a MLMultiArray output in Vision with my CoreML model

I am trying to use my CoreMl model with the Vision framework in swift. My model outputs a MLMultiArray. When I run it through Vision I do get an output, however the output is of type VNObservation, ...
jasoninthecloud's user avatar
0 votes
0 answers
33 views

How to remove extra noise and detect the bounce point in a 2d image frame using VNDetectTrajectoryRequest in IOS?

The 2-d image frame is extracted from a live/ pre-recorded video where the camera is placed behind one player so that the complete tennis court is visible in the frame. The court detection and ball ...
Shivansh Rastogi's user avatar
0 votes
0 answers
14 views

Pytorch model to coreml model for using image classifier

model photo i trained pytorch model, after than i convert it for coremlmodel and it gives me a folder named mlpackage. i can't use it for image classifier, here is the converting code : import torch ...
Arda Emin Çimen's user avatar
0 votes
1 answer
57 views

How to reshape MLMultipArray in Swift

I'm trying to colorize image using coreML, and the model always returns (1, 3, 256, 256) as result. I'm reshaping to convert it to (3, 256, 256) but not sure if it's correct way. Is there no way to ...
GPIT's user avatar
  • 3
0 votes
0 answers
43 views

obj-c iOS TensorFlow Lite using GPU delegate with MoveNet Lightning model failure

I'm using TensorFlow Lite and I'm attempting to use a GPU processing delegate with the move net multi-pose model. The interpreter initialization fails with an ambiguous error. I'm attempting to use ...
user3335999's user avatar
0 votes
0 answers
18 views

Can't use mlpackages when making a React Native NPM Package

I am trying to create a react-native-vision-camera frame processor packaged as a NPM package just like the examples here. I am trying to use some .mlpackage files from CoreML that I compiled from some ...
Carl Schader's user avatar
0 votes
1 answer
53 views

CoreMl issue with xcode , multiple resources named 'coremldata.bin' in target 'AppModule'

I am working on my swift playgrounds project. I added the FitnessMoves.mlmodelc file to my playgrounds project. But the i get the multiple resources named 'coremldata.bin' in target 'AppModule' error ...
Omer Senol's user avatar
0 votes
2 answers
30 views

In Flutter, how do I display CVPixelBuffer from iOS in a Widget?

I have a Flutter app that calls an object detector in CoreML via the iOS platform channel. I would like to ensure the model is getting the image in the correct format by viewing it in a Flutter widget....
Fred's user avatar
  • 323
0 votes
0 answers
31 views

Optimizing a CoreML model for real-time object detection on low-power iOS devices using Swift

Background: I have experience working with Swift and CoreML, and I'm interested in creating a real-time object detection system that can run on iOS devices. I have a pre-trained CoreML model that I ...
Amruthaprasad's user avatar
0 votes
0 answers
70 views

Loading Core ML Model in Swift

I am trying to make an app playground that will classify a photo as Apple or Orange. I have a model file called "AppleOrange.mlmodel" that is trained for this. But I cannot load the model ...
user avatar
0 votes
0 answers
27 views

typeerror: Image input, 'imagePath' must be of type PIL.Image.Image in the input dict

Good morning everyone, I have my .mlmodel trained on license plates with size of 1920x1080. My video test is also in the same resolution, when I am running the code it returns this error: typeerror: ...
Elise siera's user avatar
0 votes
0 answers
36 views

Static library can't find CoreML model

I am going absolutely insane after 16-20 hours of debugging this. I am building a static library (for React Native, if that matters) that makes use of a core ml model, let's call it FakeModel.mlmodel. ...
ejanson's user avatar
  • 469
0 votes
1 answer
86 views

Code=9 "Could not create inference context" CoreML iOS

I am new to CoreMl and following the instruction from Classifying Images with Vision and Core ML . I ran into an issue while using a model (MobileNetV2) give code from the previous link, I had no ...
Qazi Ammar's user avatar
0 votes
0 answers
30 views

How to convert AnimeGANV2 to coreML?

I am trying to convert PyTorch implementation of AnimeGANv2 into coreML. I don’t have any experience with Python & Python packages. I have done it based on the documentation that is available on ...
Muhammet Güler's user avatar
0 votes
0 answers
132 views

Unable to load model, Compile the model with Xcode or `MLModel.compileModel(at:)`. SwiftUI Stable Diffusion

I am trying to run Stable Diffusion's CoreML model with a SwiftUI app, on an M2 pro mac, with MacOS Ventura 13.2.1. I have downloaded the Core ML Stable Diffusion Models from Hugging Face Hub, and ...
Anon.eth's user avatar
0 votes
0 answers
68 views

How to extract bounding box coordinates from a YolovV5 object detection model that has been converted to a CoreML model for use in an iOS app?

Here is my coreMl model prediction I need something like that, I need this kind of prediction I have tried it for export !python export.py --weights /content/drive/MyDrive/best.pt --include "...
Dhiman Das's user avatar
0 votes
0 answers
39 views

In CoreML, how do I get the inference time

I'm running the yolov8 model with CoreML. I have the following Swift code that runs an object detection model: class CoreMLModule: InferenceModule { private var requests = [VNRequest]() private ...
Fred's user avatar
  • 323
2 votes
2 answers
509 views

How can I convert a YOLOv8s model to coreML model using a custom dataset?

I have trained a YOLOv8 object detection model using a custom dataset, and I want to convert it to a Core ML model so that I can use it on iOS. After exporting the model, I have a converted model to ...
Dhiman Das's user avatar
0 votes
0 answers
19 views

Problem decoding this Core ML document. validator error: Layer '/fpn/Resize' consumes an input named '' which is not present in this network

I am trying to convert a YOLACT PyTorch model to CoreML. I have been following the instructions laid out by Ma-Dan in his Yolact-CoreML repository: https://github.com/Ma-Dan/Yolact-CoreML. I ...
tummy's user avatar
  • 1
0 votes
1 answer
40 views

CoreML error: "Image is not expected type 32BGRA or 32ARGB"

I use YOLO based detector with NMS on output. If I use CoreML directly, I get this error: Image is not expected type 32BGRA or 32ARGB, instead is Unsupported (875704422) Code to call looks like this:...
Gralex's user avatar
  • 4,255
0 votes
1 answer
26 views

Passing an MLMultiArray (or CGImage) to PencilKit so it can be edited

Is it possible to initialize my PKCanvasView.drawing from an MLMultiArray or CGImage so that the user can edit it? I have a semantic segmentation model that outputs the MLMultiArray of 1s (detected) ...
stuvx's user avatar
  • 1
1 vote
0 answers
38 views

Converting Torchvision object detection models to CoreML

Is there a demo/example on how to convert Torchvision object detection models to CoreML? It's strange that CoreML documentation has tutorials for Torchvision classification and segmentation, but not ...
Alcibiades's user avatar
1 vote
0 answers
30 views

Separate the results of VNCoreMLRequest

I am trying to count the number of spokes of multiple objects on a button tap. But with the implementation that I have done, I am able to get the total number of spokes only and not able to segregate ...
Jobins John's user avatar
  • 1,273
0 votes
0 answers
34 views

CoreML - huggingface Optimum: Convert BetterTranformer model - no support for _nested_tensor_from_mask

I optimized a huggingface model with the BetterTransformer framework using huggingface optimum. Here the simple code snippet: from transformers import AutoModelForSequenceClassification from optimum....
ALPacker's user avatar
0 votes
0 answers
46 views

Convert a coreml-model to other formats

Does anyone know a way or idea of how to convert an existing apple coreml-model (a .mlmodel-file) into any other format like tensorflow, ONNX or pytorch? I can't find any way of using my existing ...
Fabian Ober's user avatar
0 votes
0 answers
9 views

Generated inputs and outputs for downloaded CoreML models

I used to have built-in CoreML model in my project, that generated input and output classes during compile time. Those classes (let's say it's ClassificatorInput and ClassificatorOutput) are used for ...
Alex Sh.'s user avatar
  • 569
0 votes
0 answers
24 views

libc++abi.dylib: terminating with uncaught exception of type NSException while using upperBodyOnly for VNdetectHumanRectanglesRequest

I am trying to run VNDetectHumanRectanglesRequest from apple developer Vision library The error is rising when i request.upperBodyOnly = false let requestHandler = VNImageRequestHandler(cgImage: image,...
Akhil Ashref's user avatar
0 votes
0 answers
28 views

Is it safe to load coreml models (uncompiled and compiled) from untrusted sources?

ML models stored in Python pickle files can run arbitrary code when loaded. Do the formats used by CoreML suffer from similar security issues? The uncompiled format appears to be based on protobuf ...
mushroom's user avatar
  • 6,141
0 votes
0 answers
56 views

CoreML, Vision: How to train a model read Specific Text Values from Image

I have a Paper Form containing Loan informations (see attachment). I want to pick-up/read information like Past Due, Current Due, Total Due etc. from this form when its image capture by a Camera. Can ...
Gurjit Singh's user avatar
  • 1,723
2 votes
0 answers
249 views

Is there a way to have SwiftUI Previews ignore specific files to prevent another build?

We have an MLPackage file in our SwiftUI project. Whenever we try to load Previews on a View file, Xcode gets stuck in an infinite loop of "Build for Previews". The builds succeed, but ...
Nate Lowry's user avatar
0 votes
0 answers
39 views

How to use data from the depth sensor in the front camera to detect objects blocking the user?

I want to detect if any object is blocking human body or not while scanning the human body using depth data or any other method.
saroj raut's user avatar
0 votes
0 answers
15 views

how to convert imagenet/mobilenet_v2_130_224/classification into mlmodel

i m very new to this but I am trying to solve the issue somehow. this is my convert.py file import numpy as n import tensorflow as tf import coremltools as ct print(n.__version__) print(tf.__version__)...
asduskun's user avatar
0 votes
0 answers
18 views

iOS CoreML is it possible to disable the "Input Validation"

The CoreML instrument tool report shows that in each Prediction, there is 5 step. Input validation Neural Engin copy Neural Engine request Neural Engine Prediction Neural Engin copy The total ...
js-john's user avatar
  • 45
0 votes
0 answers
74 views

Training ML Models on iOS Devices

Is there any way to train PyTorch models directly on-device on an iPhone via the GPU? PyTorch Mobile docs seems to be completely focused on inference only, as do the iOS app examples (https://github....
Anish Shanbhag's user avatar
4 votes
2 answers
317 views

Wrong offsets when displaying multiple VNRecognizedObjectObservation boundingBoxes using SwiftUI

I am using Vision to detect objects and after getting [VNRecognizedObjectObservation] I transform the normalized rects before showing them: let transform = CGAffineTransform(scaleX: 1, y: -1)....
Swiftly's user avatar
  • 133
0 votes
0 answers
78 views

Proper way converting TorchScript Version to Core ML

I'm trying to convert PyTorch ml model into Core ML. As shown in this WWDC video, I first converted it to TorchScript Version. But the problem happens when converting TorchScript Version to Core ML. ...
Seungjun's user avatar
  • 844
2 votes
1 answer
174 views

Coordinates from object detection Core ML model

I created an ML Model for simple object detection. When I used it in the Xcode "Preview" tab, it perfectly identified and put a bounding box around the object. However, when I try to do it ...
Ben A.'s user avatar
  • 507
0 votes
0 answers
89 views

generate CoreML Encryption key when signed in with ANOTHER iCloud account

I have a mac where I am signed in with my own iCloud account. One of my projects is on a team to which I was granted access via a DIFFERENT apple id. I sign in to Xcode with that second account and ...
zaitsman's user avatar
  • 8,936
0 votes
0 answers
57 views

Xcode encrypt mlmodel and distribute outside CloudKit and outside the app

I want to encrypt my mlmodel using Xcode key but NOT bundle it in the app nor load it into CloudKit. I want to have my app download the encrypted model and load it from file. The encryption set up is ...
zaitsman's user avatar
  • 8,936
0 votes
0 answers
49 views

'init()' is deprecated: Use init(configuration:) instead and handle errors appropriately

I am writing a code for a Sentiment Analysis using Swift, but I get this error ('init()' is deprecated: Use init(configuration:) instead and handle errors appropriately.), when writing this line of ...
Saksham Vikram's user avatar
0 votes
0 answers
75 views

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 ...
Lutfi Shah's user avatar
3 votes
2 answers
957 views

coreml Failed to get the home directory when checking model path

I wanted to create an image classifier with create ML. However, when I build, I get this error. The target and path are correct, but I don't know why I'm getting this error. Tried to set the path ...
Jerry's user avatar
  • 41
1 vote
1 answer
757 views

ModuleNotFoundError: No module named 'coremltools'

I am new in CoreML and I am facing problem while converting file to mlmodule my code is like this import coremltools caffe_model = ('oxford102.caffemodel','deploy.prototxt') labels = 'flower-labels....
Muju's user avatar
  • 925
0 votes
0 answers
30 views

Is it possible to convert Core ML output to a string

I have managed to change input requirements of my model but I couldn't manage to change the output. my aim is having a string output rather then a multiArrayType. I don't even know is it possible or ...
kare's user avatar
  • 1
1 vote
1 answer
30 views

How to unarchive MLMultiArray with NSKeyedUnarchiver?

I want to store MLMultiArray data predicted from CoreML into local file, because Core Data does not support for this type, I tried out NSKeyedUnarchiver, as MLMultiArray conforms to NSObject. However, ...
MazzzyStar's user avatar

1
2 3 4 5
19