Skip to content

Commit

Permalink
Minor fix on yolov5 webcam demo (#466)
Browse files Browse the repository at this point in the history
* 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 <Olivier.Michel@cyberbotics.com>
  • Loading branch information
tsampazk and omichel authored Sep 26, 2023
1 parent a3c1cfe commit f4ff8b1
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit f4ff8b1

Please sign in to comment.