This repository was archived by the owner on Nov 13, 2025. It is now read-only.
Open
Conversation
Xierumeng
reviewed
Feb 16, 2025
| 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 |
| 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 |
5f0f8ec to
cf7e72f
Compare
cf7e72f to
58ef535
Compare
Xierumeng
reviewed
Mar 11, 2025
| ) -> tuple[bool, base_detect_target.BaseDetectTarget | None]: | ||
| """ | ||
| Construct detect target class at runtime. | ||
| Factory function to create a detection target object. |
Collaborator
There was a problem hiding this comment.
a detect target object.
| save_name: filename prefix for logging detections and annotated images. | ||
| """ | ||
| self.__local_logger = local_logger | ||
| self.__device = config.device |
Collaborator
There was a problem hiding this comment.
Add empty line above this line.
| ): | ||
| self.__local_logger.warning("CUDA not available. Falling back to CPU.") | ||
| self.__device = DetectTargetUltralyticsConfig.CPU_DEVICE | ||
| self.__enable_half_precision = self.__device != DetectTargetUltralyticsConfig.CPU_DEVICE |
Collaborator
There was a problem hiding this comment.
Add empty line above this line.
Comment on lines
71
to
72
| if config.override_full: | ||
| self.__enable_half_precision = False |
Collaborator
There was a problem hiding this comment.
Move this closer to the enable half precision declaration.
|
|
||
| # Annotated image | ||
| cv2.imwrite(filename + ".png", image_annotated) # type: ignore | ||
| cv2.imwrite(filename + ".png", image_annotated) |
Collaborator
There was a problem hiding this comment.
Save the image using the logger.
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.