Spaces:
Running
Running
debug logs
Browse files
comic_panel_extractor/server.py
CHANGED
|
@@ -100,10 +100,22 @@ async def convert_comic(file: UploadFile = File(...)):
|
|
| 100 |
with open(file_path, "wb") as f:
|
| 101 |
f.write(content)
|
| 102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
# Extract panels
|
| 104 |
config = Config()
|
| 105 |
config.input_path = file_path
|
| 106 |
config.output_folder = specific_output_folder
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
_, _, all_panel_path = ComicPanelExtractor(config, reset=False).extract_panels_from_comic()
|
| 108 |
all_panel_path = [f'/{base_output_folder}{path.split(output_folder)[-1]}' for path in all_panel_path]
|
| 109 |
|
|
|
|
| 100 |
with open(file_path, "wb") as f:
|
| 101 |
f.write(content)
|
| 102 |
|
| 103 |
+
# 🔍 DEBUG: Log file info
|
| 104 |
+
print("======== DEBUG: Upload Info ========")
|
| 105 |
+
print(f"Working Dir: {os.getcwd()}")
|
| 106 |
+
print(f"Saved file path: {file_path}")
|
| 107 |
+
print(f"Output folder: {specific_output_folder}")
|
| 108 |
+
print(f"List of files in output folder: {os.listdir(specific_output_folder)}")
|
| 109 |
+
print("====================================")
|
| 110 |
+
|
| 111 |
# Extract panels
|
| 112 |
config = Config()
|
| 113 |
config.input_path = file_path
|
| 114 |
config.output_folder = specific_output_folder
|
| 115 |
+
|
| 116 |
+
print(f"[DEBUG] Setting config.input_path to: {config.input_path}")
|
| 117 |
+
print(f"[DEBUG] Setting config.output_folder to: {config.output_folder}")
|
| 118 |
+
|
| 119 |
_, _, all_panel_path = ComicPanelExtractor(config, reset=False).extract_panels_from_comic()
|
| 120 |
all_panel_path = [f'/{base_output_folder}{path.split(output_folder)[-1]}' for path in all_panel_path]
|
| 121 |
|