Git Product home page Git Product logo

Comments (7)

raedle avatar raedle commented on July 3, 2024

@JohnZcp, the YOLOv5 model is not supported out of the box. IIRC, there is 1 additional native data processing step missing at the moment. Let me know if you are interested in adding the step, and we can help/advice!

from playtorch.

JohnZcp avatar JohnZcp commented on July 3, 2024

I checked the output through Colab. At this moment, the prediction result I got from the ptl file is a tuple of list of tensor (Tensor,[Tensor, Tensor, Tensor]). Generally, the prediction result of yolo_v5 is a object (before I convert the model to ScriptModule). The object should able to return the following info - xmin, ymin, xmax, ymax, confidence, class, name, by using method object.xyxy(0). I guess the first tensor is equivalent to the bounding box(xmin, ymin, xmax, ymax) and the tensors in the list are the confidence, class, and name. However, the tuple and list type of are not supported on iOS for "unpack" section in the spec.json. If I understand correctly, I think the biggest problem are the structure of "unpack", and how to pre-process the first tensor of the output in the spec.json.

from playtorch.

JohnZcp avatar JohnZcp commented on July 3, 2024

@raedle Can you explain more about the native data processing step you mentioned above?

from playtorch.

raedle avatar raedle commented on July 3, 2024

@JohnZcp, the pack and unpack data processing steps are in the following folders:

Android

iOS

A good example to look at would be the bounding_boxes unpacker that's used for the DETR model.

We are working on a solution that will make the integration easier, but it's probably going to take a bit until it's stable. That said, we are looking for feedback from the community, so let us know if you want to experiment with this API

from playtorch.

JohnZcp avatar JohnZcp commented on July 3, 2024

@raedle Yes. And I wonder what should I do if I want to design a unpacker for yolo_v5. I want to have a try, but not sure how.

from playtorch.

raedle avatar raedle commented on July 3, 2024

@JohnZcp, do you have a torchscripted YOLOv5 model that runs in the lite interpreter runtime, and can you share the model with me with example input/output processing?

Feel free to DM me on the PyTorch Live Discord channel to work out a solution for YOLOv5

from playtorch.

chrisklaiber avatar chrisklaiber commented on July 3, 2024

Closing this issue out since the packer / unpacker approach was removed with 0.2.2. Check out the PyTorch-inspired API in the README as an alternative that avoids these issues: https://github.com/facebookresearch/playtorch/tree/main/react-native-pytorch-core#example-usage

As an additional note, see the YOLOv5 example for how to unpack using the current APIs: https://playtorch.dev/docs/tutorials/snacks/yolov5/

from playtorch.

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.