From f4ff8b1292ac9aa9e37354c726d8add2087f34a6 Mon Sep 17 00:00:00 2001 From: Kostas Tsampazis <27914645+tsampazk@users.noreply.github.com> Date: Tue, 26 Sep 2023 09:43:17 +0300 Subject: [PATCH] Minor fix on yolov5 webcam demo (#466) * Importing torch on yolov5 webcam demo to fix cuDNN error * Re-attempting noqa * Dummy usage of torch to avoid unused pep8 error * Removed print from dummy usage and added comment --------- Co-authored-by: Olivier Michel --- .../perception/object_detection_2d/yolov5/webcam_demo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/python/perception/object_detection_2d/yolov5/webcam_demo.py b/projects/python/perception/object_detection_2d/yolov5/webcam_demo.py index 280e3c25d1..fd87061169 100644 --- a/projects/python/perception/object_detection_2d/yolov5/webcam_demo.py +++ b/projects/python/perception/object_detection_2d/yolov5/webcam_demo.py @@ -16,6 +16,8 @@ import cv2 import time +# Importing torch to avoid "RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED" error +import torch from opendr.engine.data import Image from opendr.perception.object_detection_2d import YOLOv5DetectorLearner @@ -44,6 +46,7 @@ def __next__(self): if __name__ == '__main__': + torch.__version__ # Dummy usage of torch to avoid imported but not used pyflakes error parser = argparse.ArgumentParser() parser.add_argument("--device", help="Device to use (cpu, cuda)", type=str, default="cuda", choices=["cpu", "cuda"]) parser.add_argument("--model", help="Model to use", type=str, default="yolov5s",