Spaces:
Sleeping
Sleeping
Update doors_fasterrcnn.py
Browse files- doors_fasterrcnn.py +10 -0
doors_fasterrcnn.py
CHANGED
|
@@ -304,7 +304,17 @@ 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 |
rect = fitz.Rect(x1, y1, x2, y2)
|
|
|
|
|
|
|
| 308 |
rect_annot = page.add_rect_annot(rect)
|
| 309 |
rect_annot.set_border(width=2) # Adjust border width
|
| 310 |
rect_annot.set_colors(stroke=(1, 0, 0)) # Red rectangle
|
|
|
|
| 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"):
|
| 310 |
+
print(y1)
|
| 311 |
+
print("x2"):
|
| 312 |
+
print(x2)
|
| 313 |
+
print("y2"):
|
| 314 |
+
print(y2)
|
| 315 |
rect = fitz.Rect(x1, y1, x2, y2)
|
| 316 |
+
print("RECT"):
|
| 317 |
+
print(rect)
|
| 318 |
rect_annot = page.add_rect_annot(rect)
|
| 319 |
rect_annot.set_border(width=2) # Adjust border width
|
| 320 |
rect_annot.set_colors(stroke=(1, 0, 0)) # Red rectangle
|