Spaces:
Running
Running
fix
Browse files- comic_panel_extractor/cli.py +7 -10
comic_panel_extractor/cli.py
CHANGED
|
@@ -28,16 +28,16 @@ class ComicPanelCLI:
|
|
| 28 |
Examples:
|
| 29 |
comic-extract comic.jpg
|
| 30 |
comic-extract comic.jpg --config config.json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
"""
|
| 32 |
)
|
| 33 |
|
| 34 |
# Required arguments
|
| 35 |
-
parser.add_argument(
|
| 36 |
-
"input_path",
|
| 37 |
-
help="Path to the comic image file"
|
| 38 |
-
)
|
| 39 |
-
|
| 40 |
-
# Configuration file
|
| 41 |
parser.add_argument(
|
| 42 |
"--config",
|
| 43 |
help="Path to JSON configuration file"
|
|
@@ -70,10 +70,7 @@ Examples:
|
|
| 70 |
setattr(config, key, value)
|
| 71 |
except Exception as e:
|
| 72 |
print(f"⚠️ Warning: Could not load config file: {e}", file=sys.stderr)
|
| 73 |
-
|
| 74 |
-
# Override with command line arguments
|
| 75 |
-
config.input_path = args.input_path
|
| 76 |
-
|
| 77 |
return config
|
| 78 |
|
| 79 |
def main():
|
|
|
|
| 28 |
Examples:
|
| 29 |
comic-extract comic.jpg
|
| 30 |
comic-extract comic.jpg --config config.json
|
| 31 |
+
|
| 32 |
+
config.json example:
|
| 33 |
+
{
|
| 34 |
+
"input_path": image_path,
|
| 35 |
+
"output_folder": output_dir
|
| 36 |
+
}
|
| 37 |
"""
|
| 38 |
)
|
| 39 |
|
| 40 |
# Required arguments
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
parser.add_argument(
|
| 42 |
"--config",
|
| 43 |
help="Path to JSON configuration file"
|
|
|
|
| 70 |
setattr(config, key, value)
|
| 71 |
except Exception as e:
|
| 72 |
print(f"⚠️ Warning: Could not load config file: {e}", file=sys.stderr)
|
| 73 |
+
|
|
|
|
|
|
|
|
|
|
| 74 |
return config
|
| 75 |
|
| 76 |
def main():
|