Spaces:
Sleeping
Sleeping
Update doors_fasterrcnn.py
Browse files- doors_fasterrcnn.py +4 -2
doors_fasterrcnn.py
CHANGED
|
@@ -297,8 +297,10 @@ def add_annotations_to_pdf(image, pdf_name, lines, sanda, char_width, line_midpo
|
|
| 297 |
tpl2 = (doubleD_bbox[i][2], doubleD_bbox[i][3])
|
| 298 |
tpl_derotated = fitz.Point(*tpl1) * derotationMatrix
|
| 299 |
tpl2_derotated = fitz.Point(*tpl2) * derotationMatrix
|
| 300 |
-
coordinates_derotated = [tpl_derotated[0],tpl_derotated[1],tpl2_derotated[0],tpl2_derotated[1]]
|
| 301 |
-
|
|
|
|
|
|
|
| 302 |
rect_annot = page.add_rect_annot(rect)
|
| 303 |
rect_annot.set_border(width=2) # Adjust border width
|
| 304 |
rect_annot.set_colors(stroke=(1, 0, 0)) # Red rectangle
|
|
|
|
| 297 |
tpl2 = (doubleD_bbox[i][2], doubleD_bbox[i][3])
|
| 298 |
tpl_derotated = fitz.Point(*tpl1) * derotationMatrix
|
| 299 |
tpl2_derotated = fitz.Point(*tpl2) * derotationMatrix
|
| 300 |
+
#coordinates_derotated = [tpl_derotated[0],tpl_derotated[1],tpl2_derotated[0],tpl2_derotated[1]]
|
| 301 |
+
x1, y1 = tpl_derotated
|
| 302 |
+
x2, y2 = tpl2_derotated
|
| 303 |
+
rect = fitz.Rect(x1, y1, x2, y2)
|
| 304 |
rect_annot = page.add_rect_annot(rect)
|
| 305 |
rect_annot.set_border(width=2) # Adjust border width
|
| 306 |
rect_annot.set_colors(stroke=(1, 0, 0)) # Red rectangle
|