
    y h!                     :    d dl Z d dlZd Zd Zedk(  r e        yy)    Nc                     t        j                  d      } | j                  ddddt        d       | j                  d	t        dd
gdd       | j                  dt        d d       | j                  dt        d d       | j                  dt        dd       | j                  dt        dd
gdd       | j                  dt        dd
gdd       | j                  dt        dd
gdd       | j                  dt        dd
gdd       | j                  dt        dd
gdd       | j                  dd dt        d!"       | j                  d#t        g d$d%d&       | j                  d't
        d(d)       | j                  d*t
        d+d,       | j                  d-t
        d.d/       | j                  d0t        d d1       | j                  d2t        d d3       | j                  d4t
        d.d+gd+d5       | j                  d6t        d d7       | j                  d8t        dd
gd
d9       | j                  d:t
        d;d<       | j                  d=t        d>d?       | j                  d@t        dAdB       | j                  dCt        dDdE       | j                  dFt        dGdH       | j                  dIt        dGdJ       | j                  dKt
        dLdM       | j                  dNt        dOdP       | j                  dQt        d>dR       | j                  dSt        dAdT       | j                  dUt        dAdV       | j                  dWt        dAdX       | j                  dYt        dAdZ       | j                  d[t        dOd\       | j                  d]t        d>d^       | j                  d_t        g d`dda       | j                         }|S )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     g/home/developers/rajanand/mypropertyqr-fmb-refixing-v2/venv/lib/python3.12/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                     t               } t        j                  | j                  | j                  | j
                  | j                  | j                  | j                  | j                  | j                  | j                  | j                  
      }|j                  | j                  | j                  | j                   | j"                  | j$                  | j&                  | j(                  | j*                  | j,                  | j.                  | j0                  | j2                  | j4                  | j6                  | j8                  | j:                  | j<                  | j>                  | j@                  | jB                  | jD                  | jF                  | jH                  | jJ                  | jL                  | jN                        D ]  }tQ        |        y )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      sR   <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r"   __main__)r   rF   r   rN   __name__ r"   r!   <module>rR      s,     iX&R zF r"   