mirror of
				https://github.com/qurator-spk/ocrd-galley.git
				synced 2025-10-31 11:14:12 +01:00 
			
		
		
		
	🎨 Expose OCR textequiv_level as a environment variable
This commit is contained in:
		
							parent
							
								
									0cb0e35e8e
								
							
						
					
					
						commit
						8ca25f3c56
					
				
					 1 changed files with 6 additions and 3 deletions
				
			
		|  | @ -2,8 +2,11 @@ | ||||||
| 
 | 
 | ||||||
| set -e  # Abort on error | set -e  # Abort on error | ||||||
| 
 | 
 | ||||||
| # Set up logging | # Configuration | ||||||
| export LOG_LEVEL=${LOG_LEVEL:-DEBUG}  # /etc/ocrd_logging.py uses this to set level for all OCR-D modules | export LOG_LEVEL=${LOG_LEVEL:-DEBUG}  # /etc/ocrd_logging.py uses this to set level for all OCR-D modules | ||||||
|  | export TEXTEQUIV_LEVEL=word | ||||||
|  | 
 | ||||||
|  | # Set up logging | ||||||
| if [ "$LOG_LEVEL" = "DEBUG" -o "$LOG_LEVEL" = "TRACE" ]; then | if [ "$LOG_LEVEL" = "DEBUG" -o "$LOG_LEVEL" = "TRACE" ]; then | ||||||
|   set -x |   set -x | ||||||
| fi | fi | ||||||
|  | @ -69,7 +72,7 @@ do_ocr() { | ||||||
| 
 | 
 | ||||||
|   ocrd_tesserocr_recognize_parameters='{ |   ocrd_tesserocr_recognize_parameters='{ | ||||||
|     "model": "GT4HistOCR_2000000", |     "model": "GT4HistOCR_2000000", | ||||||
|     "textequiv_level": "word" |     "textequiv_level": "'$TEXTEQUIV_LEVEL'" | ||||||
|   }' |   }' | ||||||
|   ocrd workspace remove-group -rf OCR-D-OCR-TESS |   ocrd workspace remove-group -rf OCR-D-OCR-TESS | ||||||
|   ocrd-tesserocr-recognize -I OCR-D-SEG-LINE -O OCR-D-OCR-TESS -p "$ocrd_tesserocr_recognize_parameters" |   ocrd-tesserocr-recognize -I OCR-D-SEG-LINE -O OCR-D-OCR-TESS -p "$ocrd_tesserocr_recognize_parameters" | ||||||
|  | @ -80,7 +83,7 @@ do_ocr_calamari() { | ||||||
| 
 | 
 | ||||||
|   ocrd_calamari_recognize_parameters='{ |   ocrd_calamari_recognize_parameters='{ | ||||||
|     "checkpoint": "/var/lib/calamari-models/GT4HistOCR/2019-07-22T15:49+0200/*.ckpt.json", |     "checkpoint": "/var/lib/calamari-models/GT4HistOCR/2019-07-22T15:49+0200/*.ckpt.json", | ||||||
|     "textequiv_level": "word" |     "textequiv_level": "'$TEXTEQUIV_LEVEL'" | ||||||
|   }' |   }' | ||||||
|   ocrd workspace remove-group -rf OCR-D-OCR-CALAMARI |   ocrd workspace remove-group -rf OCR-D-OCR-CALAMARI | ||||||
|   ocrd-calamari-recognize -I OCR-D-SEG-LINE -O OCR-D-OCR-CALAMARI -p "$ocrd_calamari_recognize_parameters" |   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