Skip to content

Commit

Permalink
fix deprecation warning (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcakyon authored Dec 31, 2022
1 parent 2ee349f commit f5a176d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion yolov5/helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pathlib import Path
import warnings

from yolov5.models.common import AutoShape, DetectMultiBackend
from yolov5.models.experimental import attempt_load
Expand Down Expand Up @@ -65,7 +66,8 @@ def load_model(

class YOLOv5:
def __init__(self, model_path, device=None, load_on_init=True):
raise DeprecationWarning('YOLOv5 class is deprecated and will be removed in future release. Use "model = yolov5.load()" instead.')
warnings.warn("YOLOv5 class is deprecated and will be removed in future release. Use 'model = yolov5.load()' instead.", DeprecationWarning)

self.model_path = model_path
self.device = device
if load_on_init:
Expand Down

0 comments on commit f5a176d

Please sign in to comment.