
    9i!                     <    S SK r S SKrS rS r\S:X  a  \" 5         gg)    Nc            	         [         R                  " SS9n U R                  SSSS[        SS9  U R                  S	[        SS
/SSS9  U R                  S[        S SS9  U R                  S[        S SS9  U R                  S[        SSS9  U R                  S[        SS
/SSS9  U R                  S[        SS
/SSS9  U R                  S[        SS
/SSS9  U R                  S[        SS
/SSS9  U R                  S[        SS
/SSS9  U R                  SS S[        S!S"9  U R                  S#[        / S$QS%S&S9  U R                  S'[
        S(S)S9  U R                  S*[
        S+S,S9  U R                  S-[
        S.S/S9  U R                  S0[        S S1S9  U R                  S2[        S S3S9  U R                  S4[
        S.S+/S+S5S9  U R                  S6[        S S7S9  U R                  S8[        SS
/S
S9S9  U R                  S:[
        S;S<S9  U R                  S=[        S>S?S9  U R                  S@[        SASBS9  U R                  SC[        SDSES9  U R                  SF[        SGSHS9  U R                  SI[        SGSJS9  U R                  SK[
        SLSMS9  U R                  SN[        SOSPS9  U R                  SQ[        S>SRS9  U R                  SS[        SASTS9  U R                  SU[        SASVS9  U R                  SW[        SASXS9  U R                  SY[        SASZS9  U R                  S[[        SOS\S9  U R                  S][        S>S^S9  U R                  S_[        / S`QSSaS9  U R                  5       nU$ )bNzProcess EasyOCR.)descriptionz-lz--lang+Tzfor languages)nargsrequiredtypehelpz--gpuFzUsing GPU (default: True))r   choicesdefaultr	   z--model_storage_directoryzDirectory for model (.pth) file)r   r   r	   z--user_network_directoryz"Directory for custom network filesz--recog_networkstandardzRecognition networksz--download_enabledzEnable Downloadz
--detectorzInitialize text detector modulez--recognizerz!Initialize text recognizer modulez	--verbosezPrint detail/warningz
--quantizezUse dynamic quantizationz-fz--filez
input file)r   r   r	   z	--decoder)greedy
beamsearchwordbeamsearchr   zdecoder algorithmz--beamWidth   zsize of beam searchz--batch_size   
batch_sizez	--workersr   znumber of processing cpu coresz--allowlistz4Force EasyOCR to recognize only subset of charactersz--blocklistzOBlock subset of character. This argument will be ignored if allowlist is given.z--detailzsimple output (default: 1)z--rotation_infozAllow EasyOCR to rotate each text box and return the one with the best confident score. Eligible values are 90, 180 and 270. For example, try [90, 180 ,270] for all possible text orientations.z--paragraphzCombine result into paragraphz
--min_size   z3Filter text box smaller than minimum value in pixelz--contrast_thsg?zText box with contrast lower than this value will be passed into model 2 times. First is with original image and second with contrast adjusted to 'adjust_contrast' value. The one with more confident level will be returned as a result.z--adjust_contrastg      ?z/target contrast level for low contrast text boxz--text_thresholdgffffff?zText confidence thresholdz
--low_textg?zText low-bound scorez--link_thresholdzLink confidence thresholdz--canvas_sizei 
  zFMaximum image size. Image bigger than this value will be resized down.z--mag_ratiog      ?zImage magnification ratioz--slope_thszfMaximum slope (delta y/delta x) to considered merging. Low value means tiled boxes will not be merged.z--ycenter_thszNMaximum shift in y direction. Boxes with different level should not be merged.z--height_thsz[Maximum different in box height. Boxes with very different text size should not be merged. z--width_thsz+Maximum horizontal distance to merge boxes.z--y_thszAMaximum vertical distance to merge boxes (when paragraph = True).z--x_thszCMaximum horizontal distance to merge boxes (when paragraph = True).z--add_marginzxExtend bounding boxes in all direction by certain value. This is important for language with complex script (E.g. Thai).z--output_format)r   dictjsonzoutput format.)	argparseArgumentParseradd_argumentstrboolintlistfloat
parse_args)parserargss     K/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/easyocr/cli.pyr   r      s   $$1CDF
   u(   #.	   "1	   #	   u   u.   u0   u#   u'      :    "	   	   -	   C	   ^	   A)    P	   u,   B	    z	   >	   (	   #	   (	   U	   (	   u	   ]	   j	   :	   P	   R	    H	   ,   DK    c                     [        5       n [        R                  " U R                  U R                  U R
                  U R                  U R                  U R                  U R                  U R                  U R                  U R                  S9
nUR                  U R                  U R                  U R                   U R"                  U R$                  U R&                  U R(                  U R*                  U R,                  U R.                  U R0                  U R2                  U R4                  U R6                  U R8                  U R:                  U R<                  U R>                  U R@                  U RB                  U RD                  U RF                  U RH                  U RJ                  U RL                  U RN                  S9 H  n[Q        U5        M     g )N)
	lang_listgpumodel_storage_directoryuser_network_directoryrecog_networkdownload_enableddetector
recognizerverbosequantize)decoder	beamWidthr   workers	allowlist	blocklistdetailrotation_info	paragraphmin_sizecontrast_thsadjust_contrasttext_thresholdlow_textlink_thresholdcanvas_size	mag_ratio	slope_thsycenter_ths
height_ths	width_thsy_thsx_ths
add_marginoutput_format))r   easyocrReaderlangr%   r&   r'   r(   r)   r*   r+   r,   r-   readtextfiler.   r/   r   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   print)r    readerlines      r!   mainrN      sN   <D^^dii $484P4P373N3N*.*<*<-1-B-B%)]]'+$(LL%)]]	4F 		(,*...+/??(,*...*...'+{{.2.@.@*...)--1->->040D0D/3/B/B)-/3/B/B,0,<,<*...*...,0,<,<+/??*...&*jj&*jj+/??.2.@.@3   B4 	d5Br"   __main__)r   rF   r   rN   __name__ r"   r!   <module>rR      s,     iX&R zF r"   