Code Monkey home page Code Monkey logo

Comments (4)

hollance avatar hollance commented on May 25, 2024

There is no such function but you can modify printChannelsForPixel() to return an array instead.

However, if you want to do this for all the pixels in the image, it's better to load the MPSImage into an array (with toFloatArray()) and then use Accelerate functions to transpose everything. (Or wait until iOS 11, where MPSImage has a readBytes function that puts all the channels together.)

from forge.

jordanhart avatar jordanhart commented on May 25, 2024

Thank you so much for all your help! Really appreciate it!

from forge.

jordanhart avatar jordanhart commented on May 25, 2024

Would you mind if I ask for clarification of what the format is after transposing the MPSimage and using the toFloatArray(). Currently ended up using the offset function in the YOLO example.

The context of what I am doing, if it helps, is trying to port the convdet function of squeezedet to this iOS example, defined as "_add_interpretation_graph" here: https://github.com/BichenWuUCB/squeezeDet/blob/master/src/nn_skeleton.py#L142

from forge.

hollance avatar hollance commented on May 25, 2024

toFloatArray() loads the data from the MPSImage slice-by-slice. The source code has a more detailed explanation. On iOS 11 you can use the MPSImage.readBytes() function to get the data in a more sensible format, such as height x width x channels.

from forge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.