Spaces:
Sleeping
Sleeping
Update doors_fasterrcnn.py
Browse files- doors_fasterrcnn.py +5 -0
doors_fasterrcnn.py
CHANGED
|
@@ -308,6 +308,10 @@ def add_annotations_to_pdf(image, pdf_name, lines, sanda, char_width, line_midpo
|
|
| 308 |
y1 = int(y1)
|
| 309 |
x2 = int(x2)
|
| 310 |
y2 = int(y2)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 311 |
print("x1:")
|
| 312 |
print(x1)
|
| 313 |
print("y1:")
|
|
@@ -316,6 +320,7 @@ def add_annotations_to_pdf(image, pdf_name, lines, sanda, char_width, line_midpo
|
|
| 316 |
print(x2)
|
| 317 |
print("y2:")
|
| 318 |
print(y2)
|
|
|
|
| 319 |
rect = fitz.Rect(x1, y1, x2, y2)
|
| 320 |
print("RECT:")
|
| 321 |
print(rect)
|
|
|
|
| 308 |
y1 = int(y1)
|
| 309 |
x2 = int(x2)
|
| 310 |
y2 = int(y2)
|
| 311 |
+
x1, x2 = min(x1, x2), max(x1, x2)
|
| 312 |
+
y1, y2 = min(y1, y2), max(y1, y2)
|
| 313 |
+
|
| 314 |
+
|
| 315 |
print("x1:")
|
| 316 |
print(x1)
|
| 317 |
print("y1:")
|
|
|
|
| 320 |
print(x2)
|
| 321 |
print("y2:")
|
| 322 |
print(y2)
|
| 323 |
+
|
| 324 |
rect = fitz.Rect(x1, y1, x2, y2)
|
| 325 |
print("RECT:")
|
| 326 |
print(rect)
|