Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arpanroy18
Copy link

No description provided.

Copy link
Collaborator

@Xierumeng Xierumeng left a 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"
Copy link
Collaborator

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 .

Comment on lines +71 to +73
if self.__device != "cpu" and not torch.cuda.is_available():
self.__local_logger.warning("CUDA not available. Falling back to CPU.")
self.__device = "cpu"
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay to leave comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants