Spaces:
Build error
Build error
Fix bugs
Browse files
app.py
CHANGED
@@ -142,7 +142,7 @@ def crop_image(pil_img, detection_result):
|
|
142 |
thickness = max(lw - 1, 1)
|
143 |
w_label, h_label = cv2.getTextSize(label, 0, fontScale=fontScale, thickness=thickness)[0]
|
144 |
cv2.rectangle(image, (x1, y1), (x1 + w_label, y1 - h_label - 3), (255, 0, 0), -1, cv2.LINE_AA)
|
145 |
-
cv2.putText(image, label, (x1, y1 - 2), cv2.FONT_HERSHEY_SIMPLEX, fontScale
|
146 |
|
147 |
return crop_images, cv_to_PIL(image)
|
148 |
|
|
|
142 |
thickness = max(lw - 1, 1)
|
143 |
w_label, h_label = cv2.getTextSize(label, 0, fontScale=fontScale, thickness=thickness)[0]
|
144 |
cv2.rectangle(image, (x1, y1), (x1 + w_label, y1 - h_label - 3), (255, 0, 0), -1, cv2.LINE_AA)
|
145 |
+
cv2.putText(image, label, (x1, y1 - 2), cv2.FONT_HERSHEY_SIMPLEX, fontScale, (255, 255, 255), thickness=thickness, lineType=cv2.LINE_AA)
|
146 |
|
147 |
return crop_images, cv_to_PIL(image)
|
148 |
|