From ff943109214607f30c13b67150d94ad832ff76e6 Mon Sep 17 00:00:00 2001 From: Darshat Shah Date: Thu, 27 Apr 2023 12:15:11 +0530 Subject: [PATCH] use model.device when calling legacy predict --- groundingdino/util/inference.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/groundingdino/util/inference.py b/groundingdino/util/inference.py index 66461bc..60e038d 100644 --- a/groundingdino/util/inference.py +++ b/groundingdino/util/inference.py @@ -153,7 +153,8 @@ class Model: image=processed_image, caption=caption, box_threshold=box_threshold, - text_threshold=text_threshold) + text_threshold=text_threshold, + device=self.model.device) source_h, source_w, _ = image.shape detections = Model.post_process_result( source_h=source_h, @@ -195,7 +196,8 @@ class Model: image=processed_image, caption=caption, box_threshold=box_threshold, - text_threshold=text_threshold) + text_threshold=text_threshold, + device=self.model.device) source_h, source_w, _ = image.shape detections = Model.post_process_result( source_h=source_h,