ó
    óÛ.j  ã                  óø   • S r SSKJr  SSKrSSKrSSKrSSKJr  SSKrSSK	J
r
Jr  SSKJr  SSKJr  \" S5      r\" S	5      r\" S
5      \" S5      \" S5      /rS r\S:X  a  \R*                  " \" 5       5        gg)a½  Evidence that production grid_locator now emits the QUE-245-decision boxes.

Runs the wired production PydanticAIGridLocator (anatomy prompt, 36-row grid,
6pt pad, declash) over the corpus and compares its boxes to the spike's pad6
reference (declash(pad6(raw model output)) from compare_finishings). Reports
per-page table-count agreement and IoU, and writes a production-boxed PDF per
document for visual confirmation against finish_pad6.pdf.
é    )ÚannotationsN)ÚPath)Ú_located_fromÚapply_finishing)Úmatch)ÚPydanticAIGridLocatorzexperiments/que245/renderz+experiments/que245/results/raw_located.jsonzdocuments/BHE_991.pdfz<documents/Q2FY25-Visa-Operational-Performance-Data-FINAL.pdfzdocuments/TMUS_Q225_991.pdfc               ƒ  ó”  #   • [         R                  " [        R                  5       5      n [	        5       n[        SUR                   SUR                   SUR                   35        S=p#/ n[         GHt  n[        R                  " [        U5      5      n[        R                  " 5       n[        SUR                   35        [        UR                  5       GHÈ  nXh   n	U	R                   R"                  U	R                   R$                  pº[&        R(                  " 5        n[+        U5      S-  nU	R-                  SS9R/                  [        U5      5        UR1                  XÕUS	-   5      I S h  v•N nS S S 5        W Vs/ s H  oÿR2                  PM     nnSS
KJn  U" XXS	-   5      u    nn[9        S[;        U R=                  UR                   SUS	-    3/ 5      5      UX«5      nU Vs/ s H  oÿR2                  PM     nnUS	-  n[?        U5      [?        U5      :H  nU[A        U5      -  n[C        UU5       VVVs/ s H  u  nnnUc  M  UPM     nnnnURE                  U5        U(       a  [G        U5      [?        U5      -  O
U(       d  SOSn[        SUS	-    S[?        U5       S[?        U5       SU(       a  SOS SUS 3
5        SnU HÃ  nUR2                  u  nnnn[        RH                  " [K        UU5      U
-  [K        UU5      U-  [M        UU5      U
-  [M        UU5      U-  5      n U	RO                  U USS9  U	RQ                  U RR                  S-   [M        SU RT                  S-
  5      4URV                   SURX                   3SUS9  MÅ     UR[                  XhUS 9  GMË     [\        S!UR                  S S"  S#3-  n!UR/                  [        U!5      5        [        S$U! 35        GMw     U(       a  [G        U5      [?        U5      -  OSn"[        S%U S&U S'U"S( S)35        g  GNµ! , (       d  f       GNº= fs  snf s  snf s  snnnf 7f)*Nzproduction locator: rows=z cols=z model=r   Ú
zp.pngéÈ   )Údpié   )Ú
page_wordsÚpad6Ú|g      ð?ç        z  pz: prod=z ref=Ú zOK ÚDIFFz	 meanIoU=z.2f)r   g{®GázÔ?gq=
×£pí?gffffffö?)ÚcolorÚwidthé   é   é   z: é   )Úfontsizer   )Ú	from_pageÚto_pageÚproduction_é   z.pdfz  saved z
=== count-agreement: Ú/z& pages | matched-box IoU vs pad6 ref: z.3fz ===)/ÚjsonÚloadsÚCACHEÚ	read_textr   ÚprintÚrowsÚcolsÚmodelÚDOCSÚfitzÚopenÚstrÚstemÚrangeÚ
page_countÚrectr   ÚheightÚtempfileÚTemporaryDirectoryr   Ú
get_pixmapÚsaveÚlocateÚregionÚquber.agents.completenessr   r   r   ÚgetÚlenÚintr   ÚextendÚsumÚRectÚminÚmaxÚ	draw_rectÚinsert_textÚx0Úy0ÚordinalÚtitleÚ
insert_pdfÚRENDER)#ÚrawÚlocÚtotal_pagesÚmatch_countÚiousÚpdfÚdocÚoutÚpnoÚpageÚwÚhÚtÚipÚprodÚttÚ
prod_boxesr   Ú_ÚwordsÚref_locÚ	ref_boxesÚcmÚpjÚvÚ	page_iousÚmean_iouÚcolrB   rC   Úx1Úy1r/   ÚoutpÚmacros#                                      Ú>/home/mande/repo/quber/experiments/que245/verify_production.pyÚmainrh       sÄ  é € Ü
�*Š*”U—_‘_Ó&Ó
'€CÜ
Ó
!€CÜ	Ð% c§h¡h Z¨v°c·h±h°Z¸wÀsÇyÁyÀkÐ
RÔSà !Ð!€KØ€DßˆtˆÜ�iŠiœ˜C›Ó!ˆÜ�iŠi‹kˆÜ��3—8‘8�*ˆoÔÜ˜Ÿ™×(ˆCØ‘8ˆDØ—9‘9—?‘? D§I¡I×$4Ñ$4ˆqÜ×,Ò,Ô.°!Ü˜!“W˜wÑ&�Ø—‘ C�Ð(×-Ñ-¬c°"«gÔ6Ø ŸZ™Z¨°°q±Ó9×9�÷ /ñ /3Ó3ªd¨Ÿ)œ)©dˆJÐ3å<Ù$ S°©'Ó2‰KˆAˆq�%Ü% f¬m¸C¿G¹GÀsÇxÁxÀjÐPQÐRUÐVWÑRWÐQXÐDYÐ[]Ó<^Ó._ÐafÐhiÓmˆGÙ-4Ó5ªW rŸœ©WˆIÐ5à˜1ÑˆKÜ�Z“¤C¨	£NÑ2ˆBØœ3˜r›7Ñ"ˆKÜ+0°¸JÔ+GÕZÒ+G™x˜q " aÈ2ŸÑ+GˆIÒZØ�K‰K˜	Ô"Þ:C”s˜9“~¬¨I«Ò6ÖU^É#ÐdgˆHÜ�C˜˜A™�w˜g¤c¨*£oÐ%6°e¼CÀ	»NÐ;KÈ1Þ ‘U fÐ-¨Y°xÀ°nðFô Gð $ˆCÛ�Ø!#§¡‘��B˜˜BÜ—y’y¤ R¨£¨q¡´#°b¸"³+À±/Ä3ÀrÈ2Ã;ÐQRÁ?ÔTWÐXZÐ\^ÓT_ÐbcÑTcÓd�Ø—‘˜t¨3°c�Ñ:Ø× Ñ  $§'¡'¨A¡+¬s°1°d·g±gÀ±kÓ/BÐ!CÈÏ
É
À|ÐSUÐVX×V^ÑV^ÐU_ÐE`ÐklÐtwÐ Óxñ	 ð
 �N‰N˜3°sˆNÔ;ñ; )ô< ˜+ c§h¡h¨s° m _°DÐ9Ñ9ˆØ�‰”�T“ÔÜ�˜˜Ð× ñI öL &*ŒC�‹Iœ˜D›	Ò!¨s€EÜ	Ð# K =°°+°Ð>dÐejÐknÐdoÐosÐ
tÕuò; :÷ /Ö.üò 4ùò
 6ùô
 [ùs]   ‚DQÄAP%Å-P"
Å.P%Å2QÅ>P7ÆAQÇ'P<Ç<<QÈ8QÉQÉGQÐ"P%Ð%
P4Ð/QÚ__main__)Ú__doc__Ú
__future__r   Úasyncior    r1   Úpathlibr   r)   Ú%experiments.que245.compare_finishingsr   r   Úexperiments.que245.scorer   Úquber.agents.grid_locatorr   rG   r"   r(   rh   Ú__name__Úrun© ó    rg   Ú<module>ru      sƒ   ðñõ #ã Û Û Ý ã ç PÝ *Ý ;á	Ð)Ó	*€ÙÐ:Ó;€áÐ	 Ó!ÙÐ	GÓHÙÐ	&Ó'ð€ò.vðb ˆzÓØ‡K‚K‘“Õð rt   