github-actions Claude Sonnet 4.6 commited on
Commit ·
4cd4e97
1
Parent(s): ff8d97c
add --debug flag to keep only panel images by default
Browse filesWithout --debug, all intermediate processing images are cleaned up after
extraction, leaving only _panel_ files in the output folder. Pass --debug
to retain all intermediate images for troubleshooting.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Files changed (4)
220 unmodified lines221222223224220 unmodified linescomic_panel_extractor/best.pt*.ptcomic_panel_extractor/filtered_comic.yamlcomic_panel_extractor/filtered_dataset220 unmodified lines221222223224225226220 unmodified linescomic_panel_extractor/best.pt*.ptcomic_panel_extractor/filtered_comic.yamlcomic_panel_extractor/filtered_datasetconfig.jsontemp/
41 unmodified lines4243444546473 unmodified lines51525354555641 unmodified lines"--config",help="Path to JSON configuration file")return parser3 unmodified linesparsed_args = self.parser.parse_args(args)# Load configurationconfig = self._load_config(parsed_args)ComicPanelExtractor(config).extract_panels_from_comic()except Exception as e:print(f"❌ Error: {e}", file=sys.stderr)41 unmodified lines42434445464748495051523 unmodified lines5657585960616241 unmodified lines"--config",help="Path to JSON configuration file")parser.add_argument("--debug",action="store_true",help="Keep all intermediate processing images in the output folder")return parser3 unmodified linesparsed_args = self.parser.parse_args(args)# Load configurationconfig = self._load_config(parsed_args)config.debug = parsed_args.debugComicPanelExtractor(config).extract_panels_from_comic()except Exception as e:print(f"❌ Error: {e}", file=sys.stderr)
49 unmodified lines50515253545549 unmodified lines# BorderPanelExtractorpanel_filename_pattern: str = r"panel_\d+_\((\d+), (\d+), (\d+), (\d+)\)\.jpg"# ConstantsSUPPORTED_EXTENSIONS: tuple = ('jpg', 'jpeg', 'png', 'JPG', 'JPEG', 'PNG')49 unmodified lines50515253545556575849 unmodified lines# BorderPanelExtractorpanel_filename_pattern: str = r"panel_\d+_\((\d+), (\d+), (\d+), (\d+)\)\.jpg"# Debug modedebug: bool = False# ConstantsSUPPORTED_EXTENSIONS: tuple = ('jpg', 'jpeg', 'png', 'JPG', 'JPEG', 'PNG')
244 unmodified lines245246247248249250244 unmodified linesaccumulated_detected_boxes.extend(remain_boxes)all_path = [file for file in os.listdir(extractor_config.output_folder) if "_panel_" in file]print(f"Processing complete. Final result saved to: {extractor_config.output_folder}")print(f"Total panels detected: {len(all_path)}")return all_path, accumulated_detected_boxes, all_processed_boxes244 unmodified lines245246247248249250251252253254255256244 unmodified linesaccumulated_detected_boxes.extend(remain_boxes)all_path = [file for file in os.listdir(extractor_config.output_folder) if "_panel_" in file]if not extractor_config.debug:for file in os.listdir(extractor_config.output_folder):if "_panel_" not in file:os.remove(os.path.join(extractor_config.output_folder, file))print(f"Processing complete. Final result saved to: {extractor_config.output_folder}")print(f"Total panels detected: {len(all_path)}")return all_path, accumulated_detected_boxes, all_processed_boxes
.gitignore+3-1
comic_panel_extractor/cli.py+6
comic_panel_extractor/config.py+3
comic_panel_extractor/llm_panel_extractor.py+6