Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove low scoring filter from LogitsDecoder #242

Merged
merged 10 commits into from
Dec 5, 2021
Merged

Conversation

zhiqwang
Copy link
Owner

@zhiqwang zhiqwang commented Dec 5, 2021

This is a follow-up PR of #238 to make the exported ONNX model can be worked on TensorRT.

import torch
from torch import Tensor
from yolort.runtime import YOLOTRTModule
from yolort.v5 import attempt_download

model_path = "yolov5n.pt"
checkpoint_path = attempt_download(model_path)

model = YOLOTRTModule(checkpoint_path)
model.eval()
samples = torch.rand(1, 3, 320, 320)
outs = model(samples)

assert isinstance(outs[0], dict)
assert isinstance(outs[0]["boxes"], Tensor)
assert isinstance(outs[0]["scores"], Tensor)

model.to_onnx("yolov5n.onnx")

@zhiqwang zhiqwang added the deployment Inference acceleration for production label Dec 5, 2021
@codecov
Copy link

codecov bot commented Dec 5, 2021

Codecov Report

Merging #242 (107a0cf) into main (e1f655a) will increase coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #242      +/-   ##
==========================================
+ Coverage   93.49%   93.62%   +0.12%     
==========================================
  Files          10       11       +1     
  Lines         661      674      +13     
==========================================
+ Hits          618      631      +13     
  Misses         43       43              
Flag Coverage Δ
unittests 93.62% <100.00%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
test/test_relaying.py 100.00% <100.00%> (ø)
test/test_runtime.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1f655a...107a0cf. Read the comment docs.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ zhiqwang
❌ pre-commit-ci[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@zhiqwang zhiqwang added the enhancement New feature or request label Dec 5, 2021
@zhiqwang zhiqwang merged commit 1adce9c into main Dec 5, 2021
@zhiqwang zhiqwang deleted the refactor-yoloinference branch December 5, 2021 10:07
ShiquanYu pushed a commit to ShiquanYu/yolov5-rt-stack that referenced this pull request Dec 27, 2021
* Remove low scoring filter from LogitsDecoder

* Fixing test_yolo_inference

* Move yolo_inference.py to runtime/yolo_tensorrt_model.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add to_onnx method in YOLOTRTModule

* [pre-commit.ci] auto fixes from pre-commit.com hooks

* Fix input device inconsistency

* Add test_trt_model_onnx_saves

* [pre-commit.ci] auto fixes from pre-commit.com hooks

* Add file not exists test

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment Inference acceleration for production enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants