Code Monkey home page Code Monkey logo

Comments (3)

asad-awadia avatar asad-awadia commented on May 22, 2024

cc @Craigacp

from tribuo.

Craigacp avatar Craigacp commented on May 22, 2024

When loading an external model you need to map from the feature names that Tribuo uses (which are set by the data source, or however else you loaded in the data and got it into an Example) to the feature indicies that the model is expecting. In the case of a structured input like an image you need to make sure that the feature values line up as pixels in the right order for the transformation function to work (in this case org.tribuo.interop.onnx.ImageTransformer). Basically you need to make sure the feature names map to a multidimensional row major input (i.e. the first feature is pixel 0,0,0, the second feature is 0,0,1 and so on). To better work with images and other dense inputs Tribuo probably needs a dense example which will minimise the memory and other overheads as compared to using the sparse examples we currently have for dense data. We started down this path in 4.1 with adding more support for dense features in some models, but the rest of the support will be in 4.3 or later.

Now specifically in the case of object detection using yolo, I don't think Tribuo is a good fit. It doesn't have an object detection structured output type, the best you'll be able to do is a multi-label output without any bounding boxes, because Tribuo's Output implementations are not expressive enough. Adding better support for structured inputs and outputs is on our roadmap, but it's quite far away as there is substantial design effort involved and we only want to do it once.

I'd recommend if you want to do object detection in Java that you use ONNX Runtime directly, https://github.com/microsoft/onnxruntime/tree/master/java. That will let you feed a tensor in (but do it from a java.nio.FloatBuffer as multidimensional Java arrays are very slow), and get the bounding boxes, labels and scores out.

from tribuo.

asad-awadia avatar asad-awadia commented on May 22, 2024

@Craigacp I see hmm ok thanks!

from tribuo.

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.