Spaces:
Runtime error
Runtime error
Commit
·
8c63f23
1
Parent(s):
626cc1b
Entering debug mode
Browse files
app.py
CHANGED
|
@@ -222,4 +222,4 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 222 |
file_output,
|
| 223 |
)
|
| 224 |
|
| 225 |
-
demo.queue(concurrency_count=4).launch()
|
|
|
|
| 222 |
file_output,
|
| 223 |
)
|
| 224 |
|
| 225 |
+
demo.queue(concurrency_count=4).launch(debug=True)
|
config.py
CHANGED
|
@@ -2,7 +2,7 @@ import imagehash
|
|
| 2 |
|
| 3 |
# -------------- Initializations ---------------------
|
| 4 |
|
| 5 |
-
DOWNLOAD_DIR = "/
|
| 6 |
|
| 7 |
FRAME_BUFFER_HISTORY = 15 # Length of the frame buffer history to model background.
|
| 8 |
DEC_THRESH = (
|
|
|
|
| 2 |
|
| 3 |
# -------------- Initializations ---------------------
|
| 4 |
|
| 5 |
+
DOWNLOAD_DIR = "/tmp"
|
| 6 |
|
| 7 |
FRAME_BUFFER_HISTORY = 15 # Length of the frame buffer history to model background.
|
| 8 |
DEC_THRESH = (
|
utils.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
import cv2
|
| 3 |
import shutil
|
| 4 |
import img2pdf
|
|
@@ -10,6 +11,14 @@ import glob
|
|
| 10 |
# without opening at once.
|
| 11 |
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
def resize_image_frame(frame, resize_width):
|
| 14 |
ht, wd, _ = frame.shape
|
| 15 |
new_height = resize_width * ht / wd
|
|
|
|
| 1 |
import os
|
| 2 |
+
import re
|
| 3 |
import cv2
|
| 4 |
import shutil
|
| 5 |
import img2pdf
|
|
|
|
| 11 |
# without opening at once.
|
| 12 |
|
| 13 |
|
| 14 |
+
def sanitize_file_name(string):
|
| 15 |
+
sanitized_string = re.sub(r'[^\w ]+', '', string)
|
| 16 |
+
sanitized_string = re.sub(r'\s+', ' ', sanitized_string)
|
| 17 |
+
sanitized_string = sanitized_string.strip()
|
| 18 |
+
|
| 19 |
+
return sanitized_string
|
| 20 |
+
|
| 21 |
+
|
| 22 |
def resize_image_frame(frame, resize_width):
|
| 23 |
ht, wd, _ = frame.shape
|
| 24 |
new_height = resize_width * ht / wd
|