-
Notifications
You must be signed in to change notification settings - Fork 37
fixed detect target image not showing #255
base: main
Are you sure you want to change the base?
Conversation
Xierumeng
left a comment
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.
| 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.
5f0f8ec to
cf7e72f
Compare
cf7e72f to
58ef535
Compare
Xierumeng
left a comment
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.
| ) -> tuple[bool, base_detect_target.BaseDetectTarget | None]: | ||
| """ | ||
| Construct detect target class at runtime. | ||
| Factory function to create a detection target object. |
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.
a detect target object.
| save_name: filename prefix for logging detections and annotated images. | ||
| """ | ||
| self.__local_logger = local_logger | ||
| self.__device = config.device |
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.
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 |
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.
Add empty line above this line.
| if config.override_full: | ||
| self.__enable_half_precision = False |
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 closer to the enable half precision declaration.
|
|
||
| # Annotated image | ||
| cv2.imwrite(filename + ".png", image_annotated) # type: ignore | ||
| cv2.imwrite(filename + ".png", image_annotated) |
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.
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 |
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 this line.
No description provided.