Spaces:
Sleeping
Sleeping
Update doors_fasterrcnn.py
Browse files- doors_fasterrcnn.py +5 -1
doors_fasterrcnn.py
CHANGED
|
@@ -304,6 +304,10 @@ def add_annotations_to_pdf(image, pdf_name, lines, sanda, char_width, line_midpo
|
|
| 304 |
#coordinates_derotated = [tpl_derotated[0],tpl_derotated[1],tpl2_derotated[0],tpl2_derotated[1]]
|
| 305 |
x1, y1 = tpl_derotated
|
| 306 |
x2, y2 = tpl2_derotated
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
print("x1:")
|
| 308 |
print(x1)
|
| 309 |
print("y1:")
|
|
@@ -312,7 +316,7 @@ def add_annotations_to_pdf(image, pdf_name, lines, sanda, char_width, line_midpo
|
|
| 312 |
print(x2)
|
| 313 |
print("y2:")
|
| 314 |
print(y2)
|
| 315 |
-
rect = fitz.Rect(
|
| 316 |
print("RECT:")
|
| 317 |
print(rect)
|
| 318 |
rect_annot = page.add_rect_annot(rect)
|
|
|
|
| 304 |
#coordinates_derotated = [tpl_derotated[0],tpl_derotated[1],tpl2_derotated[0],tpl2_derotated[1]]
|
| 305 |
x1, y1 = tpl_derotated
|
| 306 |
x2, y2 = tpl2_derotated
|
| 307 |
+
x1 = int(x1)
|
| 308 |
+
y1 = int(y1)
|
| 309 |
+
x2 = int(x2)
|
| 310 |
+
y2 = int(y2)
|
| 311 |
print("x1:")
|
| 312 |
print(x1)
|
| 313 |
print("y1:")
|
|
|
|
| 316 |
print(x2)
|
| 317 |
print("y2:")
|
| 318 |
print(y2)
|
| 319 |
+
rect = fitz.Rect(x1, y1, x2, y2)
|
| 320 |
print("RECT:")
|
| 321 |
print(rect)
|
| 322 |
rect_annot = page.add_rect_annot(rect)
|