reduce redundancy/indentation

pull/142/head
Robert Sachunsky 4 months ago
parent 01376af905
commit cfc65128b1

@ -4397,10 +4397,9 @@ class Eynollah:
self.logger.warning("will skip input for existing output file '%s'", self.writer.output_filename)
continue
if self.extract_only_images:
img_res, is_image_enhanced, num_col_classifier, num_column_is_classified = self.run_enhancement(self.light_version)
self.logger.info("Enhancing took %.1fs ", time.time() - t0)
if self.extract_only_images:
text_regions_p_1 ,erosion_hurts, polygons_lines_xml,polygons_of_images,image_page, page_coord, cont_page = self.get_regions_light_v_extract_only_images(img_res, is_image_enhanced, num_col_classifier)
ocr_all_textlines = None
pcgts = self.writer.build_pagexml_no_full_layout([], page_coord, [], [], [], [], polygons_of_images, [], [], [], [], [], cont_page, [], [], ocr_all_textlines)
@ -4413,9 +4412,8 @@ class Eynollah:
continue
else:
return pcgts
if self.skip_layout_and_reading_order:
img_res, is_image_enhanced, num_col_classifier, num_column_is_classified = self.run_enhancement(self.light_version)
self.logger.info("Enhancing took %.1fs ", time.time() - t0)
_ ,_, _, textline_mask_tot_ea, img_bin_light = self.get_regions_light_v(img_res, is_image_enhanced, num_col_classifier,
skip_layout_and_reading_order=self.skip_layout_and_reading_order)
@ -4454,9 +4452,7 @@ class Eynollah:
continue
else:
return pcgts
if not self.extract_only_images and not self.skip_layout_and_reading_order:
img_res, is_image_enhanced, num_col_classifier, num_column_is_classified = self.run_enhancement(self.light_version)
self.logger.info("Enhancing took %.1fs ", time.time() - t0)
#print("text region early -1 in %.1fs", time.time() - t0)
t1 = time.time()
if self.light_version:

Loading…
Cancel
Save