Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -68,8 +68,18 @@ def detectarCatastro(pdf):
|
|
68 |
for page_num in range(len(pdf)):
|
69 |
page = pdf.load_page(page_num)
|
70 |
pix = page.get_pixmap()
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
|
75 |
aligned_images = []
|
|
|
68 |
for page_num in range(len(pdf)):
|
69 |
page = pdf.load_page(page_num)
|
70 |
pix = page.get_pixmap()
|
71 |
+
|
72 |
+
|
73 |
+
img_array = np.frombuffer(pix.samples, dtype=np.uint8)
|
74 |
+
|
75 |
+
|
76 |
+
if pix.alpha:
|
77 |
+
img_array = img_array.reshape((pix.height, pix.width, 4))
|
78 |
+
else:
|
79 |
+
img_array = img_array.reshape((pix.height, pix.width, 3))
|
80 |
+
|
81 |
+
|
82 |
+
images.append(img_array)
|
83 |
|
84 |
|
85 |
aligned_images = []
|