Spaces:
Runtime error
Runtime error
Alex Strick van Linschoten
commited on
Commit
·
024685f
1
Parent(s):
f4f594a
fix scope bug
Browse files
app.py
CHANGED
@@ -63,7 +63,9 @@ def predict(pdf, confidence, generate_file):
|
|
63 |
document = fitz.open(pdf.name)
|
64 |
results = []
|
65 |
images = []
|
66 |
-
|
|
|
|
|
67 |
tmp_dir = tempfile.gettempdir()
|
68 |
for page_num, page in enumerate(document, start=1):
|
69 |
image_pixmap = page.get_pixmap()
|
@@ -103,9 +105,6 @@ def predict(pdf, confidence, generate_file):
|
|
103 |
tmp_dir, filename_without_extension, "redacted_pages.pdf"
|
104 |
)
|
105 |
if generate_file:
|
106 |
-
total_image_areas = 0
|
107 |
-
total_content_areas = 0
|
108 |
-
total_redaction_area = 0
|
109 |
pdf = FPDF()
|
110 |
pdf.set_auto_page_break(0)
|
111 |
imagelist = sorted(
|
|
|
63 |
document = fitz.open(pdf.name)
|
64 |
results = []
|
65 |
images = []
|
66 |
+
total_image_areas = 0
|
67 |
+
total_content_areas = 0
|
68 |
+
total_redaction_area = 0
|
69 |
tmp_dir = tempfile.gettempdir()
|
70 |
for page_num, page in enumerate(document, start=1):
|
71 |
image_pixmap = page.get_pixmap()
|
|
|
105 |
tmp_dir, filename_without_extension, "redacted_pages.pdf"
|
106 |
)
|
107 |
if generate_file:
|
|
|
|
|
|
|
108 |
pdf = FPDF()
|
109 |
pdf.set_auto_page_break(0)
|
110 |
imagelist = sorted(
|