From 63d2aceb8706432108c01428b9bf231fd8786922 Mon Sep 17 00:00:00 2001 From: shiyu22 Date: Sun, 1 May 2022 16:23:50 +0800 Subject: [PATCH] Set log level Signed-off-by: shiyu22 --- yolov5.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yolov5.py b/yolov5.py index 477d9d6..a9f10d6 100644 --- a/yolov5.py +++ b/yolov5.py @@ -1,14 +1,17 @@ import torch import numpy +import logging from towhee import register from towhee.operator import NNOperator +logging.getLogger("yolov5").setLevel(logging.WARNING) + @register(output_schema=['boxes', 'classes', 'scores']) class Yolov5(NNOperator): def __init__(self, model_name: str ='yolov5s'): super().__init__() - self._model = torch.hub.load("ultralytics/yolov5", model_name, pretrained=True) + self._model = torch.hub.load("ultralytics/yolov5", model_name, pretrained=True, verbose=False) def __call__(self, img: numpy.ndarray): # Get object detection results with YOLOv5 model