
    Ng:(                        d dgZ ddlZddlZd Z ed          d             Z ed          d             Z ed          d	             Z ed          d
             Z ed          d             Z	 ed          d             Z
 ed           G d d                      Z ed           G d d                      Zd Zd Zej        ej        j        _        dS )opkernel    Nc                       fd}|S )Nc                 F    | t           j                 j        | j        <   | S N)sysmodules__dict____name__)funcmnames    M/var/www/html/ai-engine/env/lib/python3.11/site-packages/cv2/gapi/__init__.pyparameterizedzregister.<locals>.parameterized   s    59E#DM2     )r   r   s   ` r   registerr      s$         r   zcv2.gapic                  ~    t          j        t          t          t           j        j        |                               S r   )cvgapi_GNetPackagelistmapdetailstripargss    r   networksr      s)    tC	$>$>??@@@r   c                  P    t          t          t          j        |                     S r   )r   r   r   GCompileArgr   s    r   compile_argsr      s    BND))***r   cv2c                  
    g | S r   r   r   s    r   GInr"          T7Nr   c                  
    g | S r   r   r   s    r   GOutr%      r#   r   c                  
    g | S r   r   r   s    r   ginr'   "   r#   r   c                  
    g | S r   r   r   s    r   descr_ofr)   '   r#   r   c                      e Zd Zd Z G d d          Z G d d          Z G d d          Z G d d	          Z G d
 d          Z G d d          Z	 G d d          Z
 G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d d          ZdS )GOpaquec                 *    t          j        |          S r   )r   GOpaqueTclsargtypes     r   __new__zGOpaque.__new__0   s    {7###r   c                       e Zd Zd ZdS )GOpaque.Boolc                 H    t          j        t           j        j                  S r   )r   r-   gapiCV_BOOLselfs    r   r1   zGOpaque.Bool.__new__4       ;rw///r   Nr   
__module____qualname__r1   r   r   r   Boolr3   3   #        	0 	0 	0 	0 	0r   r=   c                       e Zd Zd ZdS )GOpaque.Intc                 H    t          j        t           j        j                  S r   )r   r-   r5   CV_INTr7   s    r   r1   zGOpaque.Int.__new__8       ;rw~...r   Nr:   r   r   r   Intr@   7   #        	/ 	/ 	/ 	/ 	/r   rD   c                       e Zd Zd ZdS )GOpaque.Int64c                 H    t          j        t           j        j                  S r   )r   r-   r5   CV_INT64r7   s    r   r1   zGOpaque.Int64.__new__<       ;rw/000r   Nr:   r   r   r   Int64rG   ;   #        	1 	1 	1 	1 	1r   rK   c                       e Zd Zd ZdS )GOpaque.UInt64c                 H    t          j        t           j        j                  S r   )r   r-   r5   	CV_UINT64r7   s    r   r1   zGOpaque.UInt64.__new__@       ;rw0111r   Nr:   r   r   r   UInt64rN   ?   #        	2 	2 	2 	2 	2r   rR   c                       e Zd Zd ZdS )GOpaque.Doublec                 H    t          j        t           j        j                  S r   )r   r-   r5   	CV_DOUBLEr7   s    r   r1   zGOpaque.Double.__new__D   rQ   r   Nr:   r   r   r   DoublerU   C   rS   r   rX   c                       e Zd Zd ZdS )GOpaque.Floatc                 H    t          j        t           j        j                  S r   )r   r-   r5   CV_FLOATr7   s    r   r1   zGOpaque.Float.__new__H   rJ   r   Nr:   r   r   r   FloatrZ   G   rL   r   r]   c                       e Zd Zd ZdS )GOpaque.Stringc                 H    t          j        t           j        j                  S r   )r   r-   r5   	CV_STRINGr7   s    r   r1   zGOpaque.String.__new__L   rQ   r   Nr:   r   r   r   Stringr_   K   rS   r   rb   c                       e Zd Zd ZdS )GOpaque.Pointc                 H    t          j        t           j        j                  S r   )r   r-   r5   CV_POINTr7   s    r   r1   zGOpaque.Point.__new__P   rJ   r   Nr:   r   r   r   Pointrd   O   rL   r   rg   c                       e Zd Zd ZdS )GOpaque.Point2fc                 H    t          j        t           j        j                  S r   )r   r-   r5   
CV_POINT2Fr7   s    r   r1   zGOpaque.Point2f.__new__T       ;rw1222r   Nr:   r   r   r   Point2fri   S   #        	3 	3 	3 	3 	3r   rm   c                       e Zd Zd ZdS )GOpaque.Point3fc                 H    t          j        t           j        j                  S r   )r   r-   r5   
CV_POINT3Fr7   s    r   r1   zGOpaque.Point3f.__new__X   rl   r   Nr:   r   r   r   Point3frp   W   rn   r   rs   c                       e Zd Zd ZdS )GOpaque.Sizec                 H    t          j        t           j        j                  S r   )r   r-   r5   CV_SIZEr7   s    r   r1   zGOpaque.Size.__new__\   r9   r   Nr:   r   r   r   Sizeru   [   r>   r   rx   c                       e Zd Zd ZdS )GOpaque.Rectc                 H    t          j        t           j        j                  S r   )r   r-   r5   CV_RECTr7   s    r   r1   zGOpaque.Rect.__new__`   r9   r   Nr:   r   r   r   Rectrz   _   r>   r   r}   c                       e Zd Zd ZdS )GOpaque.Primc                 H    t          j        t           j        j                  S r   )r   r-   r5   CV_DRAW_PRIMr7   s    r   r1   zGOpaque.Prim.__new__d   s    ;rw3444r   Nr:   r   r   r   Primr   c   s#        	5 	5 	5 	5 	5r   r   c                       e Zd Zd ZdS )GOpaque.Anyc                 H    t          j        t           j        j                  S r   )r   r-   r5   CV_ANYr7   s    r   r1   zGOpaque.Any.__new__h   rC   r   Nr:   r   r   r   Anyr   g   rE   r   r   N)r   r;   r<   r1   r=   rD   rK   rR   rX   r]   rb   rg   rm   rs   rx   r}   r   r   r   r   r   r+   r+   ,   sS       $ $ $0 0 0 0 0 0 0 0/ / / / / / / /1 1 1 1 1 1 1 12 2 2 2 2 2 2 22 2 2 2 2 2 2 21 1 1 1 1 1 1 12 2 2 2 2 2 2 21 1 1 1 1 1 1 13 3 3 3 3 3 3 33 3 3 3 3 3 3 30 0 0 0 0 0 0 00 0 0 0 0 0 0 05 5 5 5 5 5 5 5/ / / / / / / / / /r   r+   c                      e Zd Zd Z G d d          Z G d d          Z G d d          Z G d d	          Z G d
 d          Z G d d          Z	 G d d          Z
 G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d  d!          Z G d" d#          Zd$S )%GArrayc                 *    t          j        |          S r   )r   GArrayTr.   s     r   r1   zGArray.__new__o   s    z'"""r   c                       e Zd Zd ZdS )GArray.Boolc                 H    t          j        t           j        j                  S r   )r   r   r5   r6   r7   s    r   r1   zGArray.Bool.__new__s       :bgo...r   Nr:   r   r   r   r=   r   r   rE   r   r=   c                       e Zd Zd ZdS )
GArray.Intc                 H    t          j        t           j        j                  S r   )r   r   r5   rB   r7   s    r   r1   zGArray.Int.__new__w       :bgn---r   Nr:   r   r   r   rD   r   v   #        	. 	. 	. 	. 	.r   rD   c                       e Zd Zd ZdS )GArray.Int64c                 H    t          j        t           j        j                  S r   )r   r   r5   rI   r7   s    r   r1   zGArray.Int64.__new__{       :bg.///r   Nr:   r   r   r   rK   r   z   r>   r   rK   c                       e Zd Zd ZdS )GArray.UInt64c                 H    t          j        t           j        j                  S r   )r   r   r5   rP   r7   s    r   r1   zGArray.UInt64.__new__       :bg/000r   Nr:   r   r   r   rR   r   ~   rL   r   rR   c                       e Zd Zd ZdS )GArray.Doublec                 H    t          j        t           j        j                  S r   )r   r   r5   rW   r7   s    r   r1   zGArray.Double.__new__   r   r   Nr:   r   r   r   rX   r      rL   r   rX   c                       e Zd Zd ZdS )GArray.Floatc                 H    t          j        t           j        j                  S r   )r   r   r5   r\   r7   s    r   r1   zGArray.Float.__new__   r   r   Nr:   r   r   r   r]   r      r>   r   r]   c                       e Zd Zd ZdS )GArray.Stringc                 H    t          j        t           j        j                  S r   )r   r   r5   ra   r7   s    r   r1   zGArray.String.__new__   r   r   Nr:   r   r   r   rb   r      rL   r   rb   c                       e Zd Zd ZdS )GArray.Pointc                 H    t          j        t           j        j                  S r   )r   r   r5   rf   r7   s    r   r1   zGArray.Point.__new__   r   r   Nr:   r   r   r   rg   r      r>   r   rg   c                       e Zd Zd ZdS )GArray.Point2fc                 H    t          j        t           j        j                  S r   )r   r   r5   rk   r7   s    r   r1   zGArray.Point2f.__new__       :bg0111r   Nr:   r   r   r   rm   r      rS   r   rm   c                       e Zd Zd ZdS )GArray.Point3fc                 H    t          j        t           j        j                  S r   )r   r   r5   rr   r7   s    r   r1   zGArray.Point3f.__new__   r   r   Nr:   r   r   r   rs   r      rS   r   rs   c                       e Zd Zd ZdS )GArray.Sizec                 H    t          j        t           j        j                  S r   )r   r   r5   rw   r7   s    r   r1   zGArray.Size.__new__   r   r   Nr:   r   r   r   rx   r      rE   r   rx   c                       e Zd Zd ZdS )GArray.Rectc                 H    t          j        t           j        j                  S r   )r   r   r5   r|   r7   s    r   r1   zGArray.Rect.__new__   r   r   Nr:   r   r   r   r}   r      rE   r   r}   c                       e Zd Zd ZdS )GArray.Scalarc                 H    t          j        t           j        j                  S r   )r   r   r5   	CV_SCALARr7   s    r   r1   zGArray.Scalar.__new__   r   r   Nr:   r   r   r   Scalarr      rL   r   r   c                       e Zd Zd ZdS )
GArray.Matc                 H    t          j        t           j        j                  S r   )r   r   r5   CV_MATr7   s    r   r1   zGArray.Mat.__new__   r   r   Nr:   r   r   r   Matr      r   r   r   c                       e Zd Zd ZdS )GArray.GMatc                 H    t          j        t           j        j                  S r   )r   r   r5   CV_GMATr7   s    r   r1   zGArray.GMat.__new__   r   r   Nr:   r   r   r   GMatr      rE   r   r   c                       e Zd Zd ZdS )GArray.Primc                 H    t          j        t           j        j                  S r   )r   r   r5   r   r7   s    r   r1   zGArray.Prim.__new__   s    9RW1222r   Nr:   r   r   r   r   r      rn   r   r   c                       e Zd Zd ZdS )
GArray.Anyc                 H    t          j        t           j        j                  S r   )r   r   r5   r   r7   s    r   r1   zGArray.Any.__new__   s    9RW^,,,r   Nr:   r   r   r   r   r      s#        	- 	- 	- 	- 	-r   r   N)r   r;   r<   r1   r=   rD   rK   rR   rX   r]   rb   rg   rm   rs   rx   r}   r   r   r   r   r   r   r   r   r   r   k   s       # # #/ / / / / / / /. . . . . . . .0 0 0 0 0 0 0 01 1 1 1 1 1 1 11 1 1 1 1 1 1 10 0 0 0 0 0 0 01 1 1 1 1 1 1 10 0 0 0 0 0 0 02 2 2 2 2 2 2 22 2 2 2 2 2 2 2/ / / / / / / // / / / / / / /1 1 1 1 1 1 1 1. . . . . . . ./ / / / / / / /3 3 3 3 3 3 3 3- - - - - - - - - -r   r   c                 
    i t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j	        t           j        j
        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j        t           j        j         t           j        j!        t           j        j"        t           j        j#        t           j        j$        i t           j%        j        t           j        j        t           j%        j        t           j        j        t           j%        j        t           j        j        t           j%        j        t           j        j        t           j%        j        t           j        j        t           j%        j	        t           j        j
        t           j%        j        t           j        j        t           j%        j        t           j        j        t           j%        j        t           j        j        t           j%        j        t           j        j        t           j%        j        t           j        j        t           j%        j        t           j        j        t           j%        j        t           j        j        t           j%        j        t           j        j        t           j%        j!        t           j        j"        t           j%        j#        t           j        j$        i t           j        j        dt           j        j        dt           j        j        dt           j        j
        dt           j        j        dt           j        j        dt           j        j        dt           j        j        dt           j        j        d	t           j        j        d
t           j        j        dt           j        j        dt           j        j        dt           j        j        dt           j        j         dt           j        j"        d fd}|S )Nzcv.gapi.CV_BOOLzcv.gapi.CV_INTzcv.gapi.CV_INT64zcv.gapi.CV_UINT64zcv.gapi.CV_DOUBLEzcv.gapi.CV_FLOATzcv.gapi.CV_STRINGzcv.gapi.CV_POINTzcv.gapi.CV_POINT2Fzcv.gapi.CV_POINT3Fzcv.gapi.CV_SIZEzcv.gapi.CV_RECTzcv.gapi.CV_SCALARzcv.gapi.CV_MATzcv.gapi.CV_GMATzcv.gapi.CV_DRAW_PRIMc                     s't          d                     j                            s't          d                     j                            t                    D ]Q\  }}|t          j        t          j        gvr.t          d                     j        |j        |                    R 	fd} _        t          |           _	         S )Nz,{} operation should have at least one input!z-{} operation should have at least one output!z.{} unsupported output type: {} in position: {}c                     t          
          t          |           k    r=t          d                    t          
          t          |                               t          t	          
|                     D ]
\  }\  }}|v rt          |t          j                  sKt          d                    j        |t          j        j        t          |          j                            |	                                |         k    rNt          d                    j        ||                  |	                                                             |	v rt          |t          j
                  sKt          d                    j        |t          j
        j        t          |          j                            |	                                	|         k    rNt          d                    j        |	|                  |	                                                             |t          |          k    rAt          d                    j        ||j        t          |          j                            t          j        j        j        g| R  }g }t                    D ]\  }}|t          j        k    r(|                    |                                           >|t          j        k    r(|                    |                                           v|	v r/|                    |                    	|                              |v r/|                    |                    |                              t          d                    j        |j        |                    t          |          dk    rt+          |          n|d         S )	Nz:Invalid number of input elements!
Expected: {}, Actual: {}z9{} invalid type for argument {}.
Expected: {}, Actual: {}zA{} invalid GArrayT type for argument {}.
Expected: {}, Actual: {}zA{} invalid GOpaque type for argument {}.
Expected: {}, Actual: {}z?{} invalid input type for argument {}.
Expected: {}, Actual: {}zMIn {}: G-API operation can't produce the output with type: {} in position: {}   r   )len	Exceptionformat	enumeratezip
isinstancer   r   r   typer-   r5   __opoutMetar   appendgetGMatGScalar
getGScalar
getGOpaque	getGArraytuple)r   itar   
out_protosout_typer/   garray_typesgopaque_typesin_typesop_id	out_typestype2strs          r   onz&op.<locals>.op_with_params.<locals>.on  s   8}}D		)) ]Hs4yy99; ; ; 's8T':':;; X X	6Aq$$%a44 i'(d!'a9LdSTggN^!_!_a a a \!_44'(l!'a,q/9RT\]^]c]c]e]eTf!g!gi i i 5 -''%a55 j'(d!'a9MtTUwwO_!`!`b b b ]1%555'(l!'a-PQBR9SU]^_^d^d^f^fUg!h!hj j j 6
 DGG||'(j!'aT!WWEU!V!VX X X $ eS[84888BJ(33 I I8rw&&%%bjjll3333++%%bmmoo6666..%%bmmM(4K&L&LMMMM--%%bll<3I&J&JKKKK#$w#VCL(2CQGGI I I ),J1(<(<5$$$*Q-Or   )
r   r   r   r   r   r   r   idstaticmethodr   )
r/   r   r   r   r   r   r   r   r   r   s
   `   r   op_with_paramszop.<locals>.op_with_params   s&    	aJQQRUR^__``` 	bKRRSVS_``aaai(( 	A 	ADAq"*L|LmLLL"#S"F3<Q??A A A M-	P -	P -	P -	P -	P -	P -	P -	P -	P -	P -	P` b!!
r   )&r   r   r=   r5   r6   rD   rB   rK   rI   rR   rP   rX   rW   r]   r\   rb   ra   rg   rf   rm   rk   rs   rr   rx   rw   r}   r|   r   r   r   r   r   r   r   r   r   r   r+   )r   r   r   r   r   r   r   s   ``` @@@r   r   r      s   INrwIMrw~ IOrw/ Irw0	
 Irw0 IOrw/ Irw0 IOrw/ Irw1 Irw1 INrw INrw Irw0 IMrw~ INrw  INrw3!" IMrw~#L(JOJO JO JN	
 J 0 J 1 J 1 J 0 J 1 J 0 J 2 J 2 JO JO JO 4  JN!M&
/
. 	0 	1	
 	1 	0 	1 	0 	2 	2 	/ 	/ 	1 	. 	/  	4!H(> > > > > > > > > >@ r   c                       fd}|S )Nc                 8    j         | _         j        | _        | S r   )r   r   )r/   op_clss    r   kernel_with_paramsz"kernel.<locals>.kernel_with_params:  s    in
r   r   )r   r   s   ` r   r   r   8  s$         r   )__all__r   r    r   r   r   r   r"   r%   r'   r)   r+   r   r   r   gapi_wip_gst_GStreamerPipeliner5   wipGStreamerPipeliner   r   r   <module>r      s  
 



       
*A A A 
*+ + + 
%   
%   
%   
*   
%</ </ </ </ </ </ </ </| 
%H- H- H- H- H- H- H- H-X} } }@   !# A   r   