Skip to content

Commit bdefa2f

Browse files
committed
fixed formaating and added string class constant
1 parent 276960f commit bdefa2f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/detect_target/detect_target_ultralytics.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class DetectTargetUltralyticsConfig:
1818
"""
1919
Configuration for DetectTargetUltralytics.
2020
"""
21+
2122
CPU_DEVICE = "cpu"
2223

2324
def __init__(
@@ -58,7 +59,10 @@ def __init__(
5859
save_name: filename prefix for logging detections and annotated images.
5960
"""
6061
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+
):
6266
self.__local_logger.warning("CUDA not available. Falling back to CPU.")
6367
self.__device = DetectTargetUltralyticsConfig.CPU_DEVICE
6468
self.__enable_half_precision = self.__device != DetectTargetUltralyticsConfig.CPU_DEVICE
@@ -72,8 +76,6 @@ def __init__(
7276
if save_name != "":
7377
self.__filename_prefix = save_name + "_" + str(int(time.time())) + "_"
7478

75-
76-
7779
def run(
7880
self, data: image_and_time.ImageAndTime
7981
) -> "tuple[bool, detections_and_time.DetectionsAndTime | None]":

0 commit comments

Comments
 (0)