File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ class DetectTargetUltralyticsConfig:
18
18
"""
19
19
Configuration for DetectTargetUltralytics.
20
20
"""
21
+
21
22
CPU_DEVICE = "cpu"
22
23
23
24
def __init__ (
@@ -58,7 +59,10 @@ def __init__(
58
59
save_name: filename prefix for logging detections and annotated images.
59
60
"""
60
61
self .__device = config .device
61
- if self .__device != DetectTargetUltralyticsConfig .CPU_DEVICE and not torch .cuda .is_available ():
62
+ if (
63
+ self .__device != DetectTargetUltralyticsConfig .CPU_DEVICE
64
+ and not torch .cuda .is_available ()
65
+ ):
62
66
self .__local_logger .warning ("CUDA not available. Falling back to CPU." )
63
67
self .__device = DetectTargetUltralyticsConfig .CPU_DEVICE
64
68
self .__enable_half_precision = self .__device != DetectTargetUltralyticsConfig .CPU_DEVICE
@@ -72,8 +76,6 @@ def __init__(
72
76
if save_name != "" :
73
77
self .__filename_prefix = save_name + "_" + str (int (time .time ())) + "_"
74
78
75
-
76
-
77
79
def run (
78
80
self , data : image_and_time .ImageAndTime
79
81
) -> "tuple[bool, detections_and_time.DetectionsAndTime | None]" :
You can’t perform that action at this time.
0 commit comments