question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

yolov5s.torchscript.ptl

See original GitHub issue

Version

1.1.0

Problem Area

react-native-pytorch-core (core package)

Steps to Reproduce

run model yolov5s.torchscript.ptl

Expected Results

get results (bbox, class)

Code example, screenshot, or link to repository

Error Possible Unhandled Promise Rejection (id: 0): Error: End of input at character 0 of promiseMethodWrapper

Did I follow this instruction to convert .pt to .ptl or am I doing something wrong? https://github.com/pytorch/android-demo-app/tree/master/ObjectDetection I ran android project pytorch mobile model worked there.

As I understand it, you need live.spec.json but where to get it for yolov5?

It’s him ? I used it but it still gives an error or I need to project it? {'config.txt': '{"shape": [1, 3, 640, 640], "stride": 32, "names": ["person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic light", "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse", "sheep", "cow", "elephant", "bear", "zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee", "skis", "snowboard", "sports ball", "kite", "baseball bat", "baseball glove", "skateboard", "surfboard", "tennis racket", "bottle", "wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple", "sandwich", "orange", "broccoli", "carrot", "hot dog", "pizza", "donut", "cake", "chair", "couch", "potted plant", "bed", "dining table", "toilet", "tv", "laptop", "mouse", "remote", "keyboard", "cell phone", "microwave", "oven", "toaster", "sink", "refrigerator", "book", "clock", "vase", "scissors", "teddy bear", "hair drier", "toothbrush"]}'}

here is the link to the issue

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:8
  • Comments:19 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
raedlecommented, Jul 14, 2022

@JohnZcp, @Aisenapio, @dongdv95, @bairock, @jslok, and @zhiqwang, the latest release 0.2.0 of PyTorch Live has a JavaScript API to pre-/post-process data. The live.spec.json is no longer needed.

I create a YOLOv5 example app with the new PyTorch Live API.

It would be fantastic if this could also work with the YOLOv5 Runtime Stack!

2reactions
zhiqwangcommented, Mar 24, 2022

Just FYI,

The official torchscript exported by yolov5 only contains the general model inferencing part, one must implement the pre-preprocess (letterbox) and post-proprocess (mainly the nms op) if they want to deploy this torchscript.

We did some experiments on yolort to embed the pre-processing and post-processing into the torchscript graph following the strategy of TorchVision’s object detection banks, as such we don’t need to write the pre-process and post-process within torchlive. So it will be very easy to deploy YOLOv5 with yolort if we could deploy the models in TorchVision on torchlive.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom Yolov5s TorchScript model does not work on Android ...
I have custom model trained on yolov5s v5 and I converted it to torchscript.ptl using ultralytics export.py with code modification as told here....
Read more >
TorchScript, ONNX, CoreML Export - YOLOv5 Documentation
This command exports a pretrained YOLOv5s model to TorchScript and ONNX formats. yolov5s.pt is the 'small' model, the second smallest model available. Other ......
Read more >
Object Detection with YOLOv5 on Android - GitLab
The Python script export.py in the models folder of the YOLOv5 repo is used to generate a TorchScript-formatted YOLOv5 model named yolov5s.
Read more >
Android Studio: Could I load my Yolov5 model (.pt file) in my ...
I search on the Internet, most of people use TFLite and Torchscript for object detection. But, I think my ...
Read more >
【目标检测】YOLOv5在Android上的部署 - 51CTO博客
快速上手. 首先来跑通官方Demo,首先下载官方提供的​ ​yolov5s.torchscript.ptl​ ​​ 下载链接:​ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found