Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,6 +17,7 @@ def save_temp_image(img):
|
|
| 17 |
return img_path, temp_dir
|
| 18 |
|
| 19 |
def run_command(command):
|
|
|
|
| 20 |
try:
|
| 21 |
result = subprocess.check_output(command, shell=True, stderr=subprocess.STDOUT, encoding='utf-8')
|
| 22 |
logging.info("Command Output: " + result)
|
|
@@ -25,6 +26,7 @@ def run_command(command):
|
|
| 25 |
logging.error(f"Command failed with error: {e.output}")
|
| 26 |
return None
|
| 27 |
|
|
|
|
| 28 |
def ocr_function_cli(img, lang_name):
|
| 29 |
img_path, temp_dir = save_temp_image(img)
|
| 30 |
command = f"surya_ocr {img_path} --langs {lang_name} --images --results_dir {temp_dir}"
|
|
|
|
| 17 |
return img_path, temp_dir
|
| 18 |
|
| 19 |
def run_command(command):
|
| 20 |
+
logging.info(f"Executing command: {command}") # Adiciona o log do comando
|
| 21 |
try:
|
| 22 |
result = subprocess.check_output(command, shell=True, stderr=subprocess.STDOUT, encoding='utf-8')
|
| 23 |
logging.info("Command Output: " + result)
|
|
|
|
| 26 |
logging.error(f"Command failed with error: {e.output}")
|
| 27 |
return None
|
| 28 |
|
| 29 |
+
|
| 30 |
def ocr_function_cli(img, lang_name):
|
| 31 |
img_path, temp_dir = save_temp_image(img)
|
| 32 |
command = f"surya_ocr {img_path} --langs {lang_name} --images --results_dir {temp_dir}"
|