mirror of
				https://github.com/qurator-spk/ocrd-galley.git
				synced 2025-10-31 03:04:12 +01:00 
			
		
		
		
	🔧 Set up logging level using /etc/ocrd_logging.py instead of "-l"
This commit is contained in:
		
							parent
							
								
									1a538dce1a
								
							
						
					
					
						commit
						71d54c6978
					
				
					 2 changed files with 13 additions and 7 deletions
				
			
		|  | @ -49,6 +49,10 @@ RUN curl -sSL -O https://github.com/tesseract-ocr/tessdata_best/archive/$TESSDAT | |||
|     rm -rf $TESSDATA_BEST_VERSION.tar.gz | ||||
| 
 | ||||
| 
 | ||||
| # Set up OCR-D logging | ||||
| COPY ocrd_logging.py /etc/ | ||||
| 
 | ||||
| 
 | ||||
| # Build ocrd_olena | ||||
| RUN pip3 install --no-cache-dir --upgrade pip && \ | ||||
|    curl -sSL -o ocrd_olena.tar.gz https://github.com/OCR-D/ocrd_olena/archive/fde4436.tar.gz && \ | ||||
|  |  | |||
|  | @ -1,7 +1,9 @@ | |||
| #!/bin/bash | ||||
| LOG_LEVEL=${LOG_LEVEL:-DEBUG} | ||||
| 
 | ||||
| set -e  # Abort on error | ||||
| 
 | ||||
| # Set up logging | ||||
| export LOG_LEVEL=${LOG_LEVEL:-DEBUG}  # /etc/ocrd_logging.py uses this to set level for all OCR-D modules | ||||
| if [ "$LOG_LEVEL" = "DEBUG" -o "$LOG_LEVEL" = "TRACE" ]; then | ||||
|   set -x | ||||
| fi | ||||
|  | @ -24,7 +26,7 @@ do_binarization() { | |||
|   ocrd_olena_binarize_paramters='{"impl": "sauvola-ms-split"}' | ||||
|   ocrd workspace remove-group -rf OCR-D-IMG-BINPAGE | ||||
|   ocrd workspace remove-group -rf OCR-D-IMG-BIN | ||||
|   ocrd-olena-binarize -l $LOG_LEVEL \ | ||||
|   ocrd-olena-binarize \ | ||||
|     -I OCR-D-IMG -O OCR-D-IMG-BINPAGE \ | ||||
|     -p "$ocrd_olena_binarize_paramters" | ||||
| } | ||||
|  | @ -34,9 +36,9 @@ do_linesegmentation_tesserocr() { | |||
| 
 | ||||
|   ocrd workspace remove-group -rf OCR-D-SEG-REGION | ||||
|   ocrd workspace remove-group -rf OCR-D-SEG-LINE | ||||
|   ocrd-tesserocr-segment-region -l $LOG_LEVEL \ | ||||
|   ocrd-tesserocr-segment-region \ | ||||
|     -I OCR-D-IMG-BINPAGE -O OCR-D-SEG-REGION | ||||
|   ocrd-tesserocr-segment-line -l $LOG_LEVEL \ | ||||
|   ocrd-tesserocr-segment-line \ | ||||
|     -I OCR-D-SEG-REGION -O OCR-D-SEG-LINE | ||||
| 
 | ||||
|   # XXX compare ocrd-tesserocr-segment* vs tesseract native | ||||
|  | @ -49,7 +51,7 @@ do_linesegmentation_sbb() { | |||
|   ocrd_sbb_textline_detector_parameters='{"model": "/var/lib/textline_detection"}' | ||||
|   ocrd workspace remove-group -rf OCR-D-SEG-REGION | ||||
|   ocrd workspace remove-group -rf OCR-D-SEG-LINE | ||||
|   ocrd-sbb-textline-detector -l $LOG_LEVEL \ | ||||
|   ocrd-sbb-textline-detector \ | ||||
|     -I OCR-D-IMG-BINPAGE -O OCR-D-SEG-LINE \ | ||||
|     -p "$ocrd_sbb_textline_detector_parameters" | ||||
| } | ||||
|  | @ -59,7 +61,7 @@ do_ocr() { | |||
| 
 | ||||
|   ocrd_tesserocr_recognize_parameters='{ "model": "GT4HistOCR_2000000" }'  # TODO mods:language + fontident → model | ||||
|   ocrd workspace remove-group -rf OCR-D-OCR-TESS | ||||
|   ocrd-tesserocr-recognize -l $LOG_LEVEL \ | ||||
|   ocrd-tesserocr-recognize \ | ||||
|     -I OCR-D-SEG-LINE -O OCR-D-OCR-TESS \ | ||||
|     -p "$ocrd_tesserocr_recognize_parameters" | ||||
| } | ||||
|  | @ -70,7 +72,7 @@ do_ocr_calamari() { | |||
|     "textequiv_level": "line" | ||||
|   }' | ||||
|   ocrd workspace remove-group -rf OCR-D-OCR-CALAMARI | ||||
|   ocrd-calamari-recognize -l $LOG_LEVEL \ | ||||
|   ocrd-calamari-recognize \ | ||||
|     -I OCR-D-SEG-LINE -O OCR-D-OCR-CALAMARI \ | ||||
|     -p "$ocrd_calamari_recognize_parameters" | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue