Skip to content

Commit a6bf6ea

Browse files
authoredApr 24, 2024
Update heatmap.py
changed float16 to float32 while dividing mask with 255. speeds up the performance of detection postprocessing
1 parent e8c98ac commit a6bf6ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎surya/postprocessing/heatmap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def detect_boxes(linemap, text_threshold, low_text):
143143

144144
mask = np.zeros_like(linemap).astype(np.uint8)
145145
cv2.fillPoly(mask, [np.int32(box)], 255)
146-
mask = mask.astype(np.float16) / 255
146+
mask = mask.astype(np.float32) / 255
147147

148148
roi = np.where(mask == 1, linemap, 0)
149149
confidence = np.mean(roi[roi != 0])

0 commit comments

Comments
 (0)