From 19c8663c8a5c1ec40e4709c739127fc5158ed673 Mon Sep 17 00:00:00 2001 From: edge Date: Sun, 8 Oct 2023 20:13:51 +0800 Subject: [PATCH 1/3] fix bug for trt inference --- models/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/common.py b/models/common.py index 75cc4e97bbc7..c368e1277b55 100644 --- a/models/common.py +++ b/models/common.py @@ -549,7 +549,7 @@ def forward(self, im, augment=False, visualize=False): assert im.shape == s, f"input size {im.shape} {'>' if self.dynamic else 'not equal to'} max model size {s}" self.binding_addrs['images'] = int(im.data_ptr()) self.context.execute_v2(list(self.binding_addrs.values())) - y = [self.bindings[x].data for x in sorted(self.output_names)] + y = [self.bindings[x].data for x in ['output','462']] elif self.coreml: # CoreML im = im.cpu().numpy() im = Image.fromarray((im[0] * 255).astype('uint8')) From 1ff4f089fb961b69af104b96ca6bd9c29a7ec2a8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 8 Oct 2023 12:23:28 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- models/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/common.py b/models/common.py index c368e1277b55..c8de7379553e 100644 --- a/models/common.py +++ b/models/common.py @@ -549,7 +549,7 @@ def forward(self, im, augment=False, visualize=False): assert im.shape == s, f"input size {im.shape} {'>' if self.dynamic else 'not equal to'} max model size {s}" self.binding_addrs['images'] = int(im.data_ptr()) self.context.execute_v2(list(self.binding_addrs.values())) - y = [self.bindings[x].data for x in ['output','462']] + y = [self.bindings[x].data for x in ['output', '462']] elif self.coreml: # CoreML im = im.cpu().numpy() im = Image.fromarray((im[0] * 255).astype('uint8')) From 749079b38ebd7a0b3effa95c9d7a1e5746fa48e9 Mon Sep 17 00:00:00 2001 From: UltralyticsAssistant Date: Wed, 17 Jan 2024 10:01:43 +0000 Subject: [PATCH 3/3] Auto-format by Ultralytics actions --- models/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/common.py b/models/common.py index 085545b95e20..f3f155917e23 100644 --- a/models/common.py +++ b/models/common.py @@ -573,7 +573,7 @@ def forward(self, im, augment=False, visualize=False): assert im.shape == s, f"input size {im.shape} {'>' if self.dynamic else 'not equal to'} max model size {s}" self.binding_addrs["images"] = int(im.data_ptr()) self.context.execute_v2(list(self.binding_addrs.values())) - y = [self.bindings[x].data for x in ['output', '462']] + y = [self.bindings[x].data for x in ["output", "462"]] elif self.coreml: # CoreML im = im.cpu().numpy() im = Image.fromarray((im[0] * 255).astype("uint8"))