Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -619,7 +619,7 @@ def predict(
|
|
619 |
# ---------------------
|
620 |
msp = doc.modelspace()
|
621 |
if annotation_text.strip():
|
622 |
-
text_x = (inner_min_x + inner_max_x) / 2.0
|
623 |
text_height_dxf = 0.5
|
624 |
text_y_dxf = inner_min_y - 0.125 - text_height_dxf
|
625 |
text_entity = msp.add_text(
|
@@ -644,7 +644,7 @@ def predict(
|
|
644 |
draw_polygons_inch(final_polygons_inch, new_outlines, scaling_factor, processed_size[0], color=(0, 0, 255), thickness=2)
|
645 |
|
646 |
if annotation_text.strip():
|
647 |
-
text_height_cv = 0.
|
648 |
text_x_img = int(((inner_min_x + inner_max_x) / 2.0) / scaling_factor)
|
649 |
text_y_in = inner_min_y - 0.125 - text_height_cv
|
650 |
text_y_img = int(processed_size[0] - (text_y_in / scaling_factor))
|
@@ -655,9 +655,9 @@ def predict(
|
|
655 |
annotation_text.strip(),
|
656 |
org,
|
657 |
cv2.FONT_HERSHEY_SIMPLEX,
|
658 |
-
1.
|
659 |
(0, 0, 255),
|
660 |
-
|
661 |
cv2.LINE_AA
|
662 |
)
|
663 |
cv2.putText(
|
@@ -665,9 +665,9 @@ def predict(
|
|
665 |
annotation_text.strip(),
|
666 |
org,
|
667 |
cv2.FONT_HERSHEY_SIMPLEX,
|
668 |
-
1.
|
669 |
(0, 0, 255),
|
670 |
-
|
671 |
cv2.LINE_AA
|
672 |
)
|
673 |
|
|
|
619 |
# ---------------------
|
620 |
msp = doc.modelspace()
|
621 |
if annotation_text.strip():
|
622 |
+
text_x = ((inner_min_x + inner_max_x) / 2.0) - (int(len(annotation_text.strip()) / 2.0))
|
623 |
text_height_dxf = 0.5
|
624 |
text_y_dxf = inner_min_y - 0.125 - text_height_dxf
|
625 |
text_entity = msp.add_text(
|
|
|
644 |
draw_polygons_inch(final_polygons_inch, new_outlines, scaling_factor, processed_size[0], color=(0, 0, 255), thickness=2)
|
645 |
|
646 |
if annotation_text.strip():
|
647 |
+
text_height_cv = 0.50
|
648 |
text_x_img = int(((inner_min_x + inner_max_x) / 2.0) / scaling_factor)
|
649 |
text_y_in = inner_min_y - 0.125 - text_height_cv
|
650 |
text_y_img = int(processed_size[0] - (text_y_in / scaling_factor))
|
|
|
655 |
annotation_text.strip(),
|
656 |
org,
|
657 |
cv2.FONT_HERSHEY_SIMPLEX,
|
658 |
+
1.2,
|
659 |
(0, 0, 255),
|
660 |
+
2,
|
661 |
cv2.LINE_AA
|
662 |
)
|
663 |
cv2.putText(
|
|
|
665 |
annotation_text.strip(),
|
666 |
org,
|
667 |
cv2.FONT_HERSHEY_SIMPLEX,
|
668 |
+
1.2,
|
669 |
(0, 0, 255),
|
670 |
+
2,
|
671 |
cv2.LINE_AA
|
672 |
)
|
673 |
|