@@ -60,10 +60,6 @@ def save_bbox_masks_labels(
60
60
threshold: Value between 0 and 1 to filter out the prediction results.
61
61
"""
62
62
image_new = image .copy ()
63
- if 'detection_masks_reframed' in result :
64
- result ['detection_masks_reframed' ] = result [
65
- 'detection_masks_reframed'
66
- ].astype (np .uint8 )
67
63
68
64
viz_utils .visualize_boxes_and_labels_on_image_array (
69
65
image_new ,
@@ -72,11 +68,11 @@ def save_bbox_masks_labels(
72
68
result ['detection_scores' ][0 ],
73
69
category_index = category_index ,
74
70
use_normalized_coordinates = True ,
75
- max_boxes_to_draw = 100 ,
71
+ max_boxes_to_draw = 70 ,
76
72
min_score_thresh = threshold ,
77
73
agnostic_mode = False ,
78
- instance_masks = result .get ('detection_masks_reframed ' , None ),
79
- line_thickness = 2 ,
74
+ instance_masks = result .get ('detection_masks_resized ' , None ),
75
+ line_thickness = 4 ,
80
76
)
81
77
82
78
cv2 .imwrite (
@@ -101,7 +97,7 @@ def save_binary_masks(
101
97
file_name: The filename for saving the output mask image.
102
98
folder: The folder path where the output mask image will be saved.
103
99
"""
104
- mask = np .zeros_like (result ['detection_masks_reframed' ][0 ])
100
+ mask = np .zeros_like (result ['detection_masks_reframed' ][0 ], dtype = np . uint8 )
105
101
result ['detection_masks_reframed' ] = result [
106
102
'detection_masks_reframed'
107
103
].astype (np .uint8 )
0 commit comments