Comments (7)
Can you add a Concat layer to the model? If not, it’s a matter of allocating a large enough memory buffer and copying things by hand. The MultiArray class is really an experimental thing, I wouldn’t use it for serious work.
from coremlhelpers.
Yikes! Is it relatively recently that you've started referring to MultiArray as "experimental"? I've been using it for a while without issue (as long as I avoid [MultiArray] structures—really not sure why that causes problems(??)), so I suppose I'm not too concerned, but it is integrated in my code fairly deeply now. Would you recommend that I remove/replace it?
As far as the concat goes, I could look into the possibility of a concat in my model. For now I've done it by hand, and it seems fine.
from coremlhelpers.
Using MultiArray is mostly fine, but there is a known issue with creating a MultiArray derived from another one. In that case it gives the wrong answers. There is a failing test case in the repo in case you're wondering exactly what I'm talking about.
from coremlhelpers.
Ah, okay. Great. Yes, as long as I avoid that I haven't had any trouble. They're handy and helpful (as "helpers", I guess they should be!)
from coremlhelpers.
Quick question: Is there a simple way to get a 3D slice from a 4D MultiArray? I have a MultiArray [4, 3, 64, 64]—i.e., just 4 x [3, 64, 64] images concatenated together—and I want to get the nth [3, 64, 64] sub matrix out.
from coremlhelpers.
Grab the pointer to the start of the MLMultiArray and increment it by n*3*64*64
and then copy the next 36464 elements. It’s just a memcpy, basically.
If you want to use MultiArray (without the ML) then you shouldn’t use the pointer but use a for loop and the subscript (because otherwise any reshaping or transposing is ignored). So now you need to loop through the array to copy out the items, which is slower than a single memcpy.
from coremlhelpers.
Thanks, I did wind up iterating over the multiArray.array, but I'll check out the memcpy version. (It's been a long time since I've used memcpy!)
from coremlhelpers.
Related Issues (20)
- How to know if coreML model would perform image-preprocessing step or not?
- Q about output Multiarray shape
- Carthage - no shared framework schemes HOT 2
- Is there any evaluation example code or helper modules on this repo? HOT 1
- Accessing elements from Dim 5 multi array not working
- Swift Package Manager Support? HOT 2
- [Feature] MLMultiArray -> UIImage without premultiplied alpha HOT 2
- Prediction discrepancies between Python's coremltools and Swift's CoreML API HOT 4
- Need help to adjust bbox for cropped images HOT 7
- pixelBuffer not public HOT 1
- MLMultiarray+Image.swift file gives error HOT 1
- How to use the transposed function? from (26, 64, 48, 1) to (1, 26, 64, 48) HOT 3
- CoreGraphics resizing function from iOS (UIImage) to MacOS (NSImage) HOT 6
- PixelBuffer function from iOS (UIImage) to MacOS (NSImage) HOT 3
- UI Image to kCVPixelFormatType_422YpCbCr8FullRange pixel format not working HOT 4
- Add support for transpose with dataType int and float
- Change image to multiArray in case of converted mlmodel from TFlite
- Question about backprop HOT 5
- "EXCLUDED_ARCHS[sdk=iphonesimulator*]": "arm64"
- Custom Model Not Working Correctly in the Application HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coremlhelpers.