-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed detect target image not showing #255
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed.
@@ -56,7 +57,7 @@ def __init__( | |||
save_name: filename prefix for logging detections and annotated images. | |||
""" | |||
self.__device = config.device | |||
self.__enable_half_precision = not self.__device == "cpu" | |||
self.__enable_half_precision = self.__device != "cpu" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this string a class constant for DetectTargetUltralyticsConfig
.
if self.__device != "cpu" and not torch.cuda.is_available(): | ||
self.__local_logger.warning("CUDA not available. Falling back to CPU.") | ||
self.__device = "cpu" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this close to where self.__device
is defined.
@@ -132,6 +137,11 @@ def run( | |||
self.__counter += 1 | |||
|
|||
if self.__show_annotations: | |||
cv2.imshow("Annotated", image_annotated) # type: ignore | |||
if image_annotated is not None: | |||
# Display the annotated image in a named window |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comment.
if image_annotated is not None: | ||
# Display the annotated image in a named window | ||
cv2.imshow("Annotated", image_annotated) | ||
cv2.waitKey(1) # Short delay to process GUI events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay to leave comment.
No description provided.