+
    ïñkÉ$  ã                   ó|  € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RI	t
^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIHt ^ R	IHtHt ]! ]4      P=                  4       P>                  ^,          t ] R
,          t!] R,          t"]! R4      t#] R,          t$R t%R t&R t'](R8X  d
   ]'! 4        R# R# )zAExplore a cumulative factor bound on the already-used R116 pairs.N)ÚPath)ÚImage)ÚYOLO)ÚLOGGER)Úsha256)Ú
preprocess)Úpools)ÚimagesÚ	placementz&results/r112/gunduz-overlap-pair-pilotz,results/r112/gunduz-cumulative-overlap-pilotz"/tmp/diatom-diamorph-species-v2.ptú,diatom_pilot/data/diatlas-taxonomic-code.csvc           	     óB  € V Uu. uF0  p\         P                  ! \         P                  ! VR4      RR4      NK2  	  ppV^ ,          V^,          ,          pV^ ,          V^,          ,          pWVR8  ,          pWVR8„  ,          pV P                  \         P                  4      V^ ,          ,          V^,          ,          p	W,          P                  \         P                  4      R,          W—&   W,          P                  \         P                  4      R,          W˜&   W”Wx3# u upi )zJApply prior bounded layers, then bound their product only in intersection.g      @ç      à?ç      ø?)ÚnpÚclipÚpowerÚastypeÚfloat32)
ÚbgÚsupportsÚfactorsÚfÚboundedÚinterÚproductÚlowÚhighÚraws
   &&&       ÚR/home/mchadwick/src/ansp/diatom-research/research/r116_cumulative_overlap_pilot.pyÚ
cumulativer      sÔ   € á:AÓB¹'°QŒr�wŠw”r—x’x  2“¨¨CÖ0¹'€GÐBØ�Q�K˜( 1�+Õ%€EØ�a�j˜7 1�:Õ%€GØ
˜R‘<Õ
 €CØ˜c‘MÕ"€DØ
�)‰)”B—J‘JÓ
 '¨!¥*Õ
,¨w°q­zÕ
9€CØ�w�~‰~œbŸj™jÓ)¨BÕ.€C�HØ•—‘¤§
¡
Ó+¨cÕ1€C�IØ˜Ð"Ð"ùò Cs   …6Dc                óV  € V^ ,          V^,          ,          pW`^û8*  ,          pV P                  \        P                  4      ^,           V^ ,          ,          V^,          ,          pW,          P                  \        P                  4      ^,           R,          W„&   W,          P                  \        P                  4      ^,           R,          W…&   \        P                  ! V^ ^ÿ4      \        P                  ! V^ ^ÿ4      ,
          ^,          p	\        P                  ! \        P                  ! V^ ^ÿ4      4      P                  R4      p
. p\        ^4       EF  p\        P                  ! \        P                  ! V P                  \        P                  4      V^V,
          ,          ,          ^ ^ÿ4      4      P                  R4      p\        P                  ! V
P                  \        P                  4      VP                  \        P                  4      ,
          4      pVP                  R\        V^ 8H  V,          P                  4       4      R\        Wæ,          P                  4       4      /4       EK  	  R\        VP                  4       4      R\        VP                  4       4      R\        VP                  4       4      R	\        V^ 8  V^ÿ8„  ,          V,          P                  4       4      R
\        VP                  4       4      R\        V	R8  V,          P                  4       4      RV/# )zDCalculate fixed-factor response and per-target omission diagnostics.r   r   Úuint8Úintersection_unchanged_pxÚintersection_mean_abs_changeÚintersection_pxÚfloor_limited_pxÚceiling_limited_pxÚintersection_out_of_range_pxÚresponse_eligible_pxÚresponse_below_half_pxÚper_target_marginalg9î”Öÿß?)r   r   r   r   ÚrintÚrangeÚabsÚint16ÚappendÚintÚsumÚfloatÚmean)r   r   r   r   r   r   r   ÚeligibleÚ	perturbedÚresponseÚpairÚmarginalÚtargetÚotherÚdiffs   &&&&&&         r   Úpixel_metricsr<   *   s5  € à�Q�K˜( 1�+Õ%€EØ˜c™	Õ"€HØ—‘œ2Ÿ:™:Ó&¨Õ*¨g°a­jÕ8¸7À1½:ÕE€IØ•g—n‘n¤R§Z¡ZÓ0°1Õ4¸Õ:€I�NØ•x—‘¤r§z¡zÓ2°QÕ6¸#Õ=€I�OÜ—’˜	 1 cÓ*¬R¯WªW°S¸!¸SÓ-AÕAÀQÕF€HÜ�7Š7”2—7’7˜3  3Ó'Ó(×/Ñ/°Ó8€DØ€HÜ˜—(ˆÜ—’œŸš §	¡	¬"¯*©*Ó 5¸ÀÀ&ÅÕ8IÕ IÈ1ÈcÓRÓS×ZÑZÐ[bÓcˆÜ�vŠv�d—k‘k¤"§(¡(Ó+¨e¯l©l¼2¿8¹8Ó.DÕDÓEˆØ�‰Ð4´c¸DÀA¹IÈÕ;N×:SÑ:SÓ:UÓ6VØ7¼¸t½{×?OÑ?OÓ?QÓ9RðT÷ 	Uñ ð
 œs 5§9¡9£;Ó/Ð1CÄSÈÏÉËÃ^ÐUiÔknÐos×owÑowÓoyÓkzØ*¬C°3¸±7¸sÀS¹yÕ2IÈUÕ1R×0WÑ0WÓ0YÓ,ZØ"¤C¨¯©«Ó$7Ø$¤c¨H°yÑ,@ÀHÕ+L×*QÑ*QÓ*SÓ&TØ! 8ð	-ð -ó    c                  ó   € \         P                  ! 4       p \        P                  ! R RR7      P	                  ^\
        P                  4      ^ 8X  g   Q hV \         P                  ! 4       8w  d   \        R4      h\        P                  ! ^4       \        P                  ! ^4       \        P                  ! R4       \        P                  RR7       \        R,          P!                  4       '       d   Q h. RTOp\"        P$                  ! \&        R,          P)                  4       4      p\"        P$                  ! \&        R,          P)                  4       4      p\"        P$                  ! \&        R,          P)                  4       4      R	,          \+        \&        R,          4      8X  g   Q h\-        VR
,          4      \-        VR,          4      u;8X  d	   ^8X  g   Q h Q hRRRV Uu/ uF  qD\+        \.        V,          4      bK  	  upR\+        \0        4      RRRRRRRR/p\        R,          P3                  \"        P4                  ! V^R7      R,           4       \        R,          P                  4        \        R,          P                  4        \6        P8                  \6        P:                  \6        P<                  \6        P>                  \6        P@                  \6        PB                  \6        PD                  \6        PF                  \6        PH                  \6        PJ                  \6        PL                  \6        PN                  \6        PP                  \6        PR                  \6        PT                  \6        PV                  \6        PX                  \6        PZ                  \6        P\                  .p\        P^                  Pa                  V4      ;_uu_ 4        \        Pb                  ! \0        RRR7      R,          Pe                  4       pR R R 4       \g        RR R!7      pXVn4        \j        Pl                  ! \n        Pq                  4       R"R#7       U	u/ uF  q™R$,          V	bK  	  p
p	\s        4       p. p\u        VR,          VR
,          4       EF…  w  rÞVR%,          VR%,          8X  g   Q h\w        WÝR&,          V4      w  pppppWþR',          8X  d   VVR(,          8X  g   Q h\y        V^ ,          V^,          ,          P{                  4       4      VR),          8X  g   Q h\}        VVR*4      w  ppp\+        \&        VR,          R*,          R+,          ,          4      VR,          R*,          R,,          8X  g   Q h\~        P€                  ! V\~        P‚                  ! \„        Pp                  ! \&        VR,          R*,          R+,          ,          4      P‡                  R-4      4      4      '       g   Q h\‰        VVV4      w  pppp\~        PŠ                  ! \~        PŒ                  ! V^ ^ÿ4      4      P�                  R.4      p\~        P€                  ! VV^ ,          V^,          ,          ( ,          VV^ ,          V^,          ,          ( ,          4      '       g   Q h\‘        VVVVVV4      pVP�                  \~        P’                  4      V^ ,          ,          V^,          ,          p\~        P”                  ! VP–                  \˜        4      p\‘        VVVVVV4      p\        R,          VR%,          R/,           ,          p \„        Pš                  ! V4      P�                  V 4       . p!\Ÿ        VR0,          4       EF  w  p"p#V#R1,          w  p$p%p&p'VV%V'1V$V&13,          P¡                  4       p(\        R,          VR%,           R2V" R/2,          p)\„        Pš                  ! V(4      P�                  V)4       VR3,          R4,          w  p*p+\£        \        P¤                  ! V(\        P¦                  4      V*V+4      p,VP©                  V,R5RR6R77      ^ ,          p-V-Pª                  P¬                  P¯                  4       P±                  4       p.\~        P²                  ! V.) R8R97      R:,          p/T!Pµ                  R;V#R;,          R1V#R1,          R<V#R=,          R>V#R?,          R@,          RA,          RBV#R?,          RC,          RA,          RDV/ U0u. uFe  p0REVP¶                  \y        V04      ,          RFW§P¶                  \y        V04      ,          ,          RG,          RH\e        V.\y        V04      ,          4      /NKg  	  up0RI\¹        V)P»                  \        4      4      RJ\+        V)4      /4       EK!  	  VPµ                  R%VR%,          R3VR3,          RK\¹        V P»                  \        4      4      RL\+        V 4      RMVRNVR0V!/4       \-        V4      ^,          ^ 8X  g   EKm  \½        RO\-        V4      RPRRQ7       EKˆ  	  \        R,          P3                  \"        P4                  ! RRRRS\+        \        R,          4      RVR,          R
V/^R7      R,           4       R # u upi   + '       g   i     ELx; iu up	i u up0i )UNT)Ú	use_errnozParent exitedÚERROR)Úexist_okzprotocol.jsonzresults.jsonzverify.jsonÚresults_sha256ÚrecordsÚpairsÚformatz#r116-cumulative-overlap-protocol-v1Úinputs_sha256Úmodel_sha256Ú	selectionz±All 25 previously viewed R116 pairs and all 50 oracle target crops; no selection by outcome. This exploration was motivated by the earlier results and is not a fresh validation.ÚmethodaŠ  Keep both prior per-layer factors clip(f**3,0.5,1.5) and all positions. Only where projected supports intersect, clamp the product of the two factors to [0.5,1.5] before multiplying by the background. Outside intersection preserve the previously saved bounded pair exactly; target-alone controls remain identical. Reuse prior predictions and infer new pair crops with the same fixed classifier.ÚoutcomeszÊRecord factor-limited pixels, clipping, the same pre-round +4 background-response proxy, and changes in the pair when each target is removed. These are renderer interventions, not anatomical visibility.Úwarninga<  These 25 hard pairs and bounds were already examined; no statistical validation, biological correctness, physical optics or Academy accuracy follows. Cumulative clamping can hide a target or flatten details. Source masks/names/scale are uncertain and real backgrounds remain unknown. No automatic training promotion.)ÚindentÚ
ÚframesÚpatchesÚcpu)Úmap_locationÚweights_onlyÚmodelzyolov8l-cls.yamlÚclassify)ÚtaskÚ;)Ú	delimiterÚtaxonomic_codeÚidÚ	instancesÚpositioned_instancesÚplacement_shift_indexr$   r   Úfiler   ÚLr!   z.pngÚtargetsÚbbox_xyxy_exclusiveÚ-Ú
backgroundÚum_per_pixel_xyi   F)ÚimgszÚdeviceÚverboseÚstable)Úkind:Né   NÚsourceÚname_in_model_vocabulary_exactÚ%source_name_in_model_vocabulary_exactÚsingle_top5Ú
conditionsÚbounded_singleÚtop5Úprevious_overlap_top5Úbounded_overlapÚcumulative_top5ÚcodeÚsource_nameÚspeciesÚscoreÚpatchÚpatch_sha256ÚframeÚframe_sha256Úprevious_bounded_metricsÚcumulative_metricsÚcomparedz
/ 25 pairs)Úflushz"r116-cumulative-overlap-results-v1Úprotocol_sha256)	z4results/r112/gunduz-overlap-pair-pilot/protocol.jsonz3results/r112/gunduz-overlap-pair-pilot/results.jsonz2results/r112/gunduz-overlap-pair-pilot/verify.jsonz2results/r112/gunduz-overlap-pair-pilot/replay.jsonr   z diatom_pilot/diamorph_preview.pyz*research/r112_gunduz_overlap_pair_pilot.pyz,research/r112_gunduz_bounded_transmission.pyz)research/r116_cumulative_overlap_pilot.py)_ÚosÚgetppidÚctypesÚCDLLÚprctlÚsignalÚSIGTERMÚRuntimeErrorÚcv2ÚsetNumThreadsÚtorchÚset_num_threadsr   ÚsetLevelÚOÚmkdirÚexistsÚjsonÚloadsÚPÚ	read_textr   ÚlenÚRÚWÚ
write_textÚdumpsÚdefsÚClassificationModelÚConvÚC2fÚ
BottleneckÚClassifyÚ
SequentialÚConv2dÚBatchNorm2dÚSiLUÚ
ModuleListÚAdaptiveAvgPool2dÚLinearÚDropoutÚComposeÚ
CenterCropÚResizeÚToTensorÚ	NormalizeÚInterpolationModeÚserializationÚsafe_globalsÚloadr2   r   rS   ÚcsvÚ
DictReaderÚTÚopenr   Úzipr
   r0   r1   r	   r   Úarray_equalÚasarrayr   Úconvertr   r+   r   r   r<   r   ÚzerosÚshapeÚboolÚ	fromarrayÚsaveÚ	enumerateÚcopyr   ÚcvtColorÚCOLOR_GRAY2BGRÚpredictÚprobsÚdatarP   ÚnumpyÚargsortr/   ÚnamesÚstrÚrelative_toÚprint)1ÚparentÚfilesÚoriginalÚoriginal_protocolr   ÚprotocolÚallowÚtrainedrS   ÚrÚtaxaÚdatasetsÚrowsÚrecipeÚpreviousÚ
positionedr   r   r   ÚshiftÚold_single_aÚold_single_bÚold_pairr   r   r   r   ÚoutÚmetricsÚreference_rawr¹   Ú	referenceÚ
frame_pathr_   Úir9   Úx0Úy0Úx1Úy1ÚcropÚfpÚsxÚsyÚpreparedÚresultÚscoresÚorderÚks1                                                    r   Úmainrð   @   s;  € Ü�ZŠZ‹\€FÜ�;Š;�t tÔ,×2Ñ2°1´f·n±nÓEÈÔJÐJÐJØ”—’“ÔÜ˜?Ó+Ð+Ü×Ò�aÔÜ	×Ò˜!ÔÜ
‡O‚O�GÔÜ‡G�G�T€GÔÜ�OÕ#×+Ñ+×-Ò-Ð-Ð-ò:€Eô
 �zŠzœ1˜~Õ-×8Ñ8Ó:Ó;€HÜŸ
š
¤A¨Õ$7×#BÑ#BÓ#DÓEÐÜ�:Š:”q˜=Õ(×3Ñ3Ó5Ó6Ð7GÕHÌFÔSTÐWeÕSeÓLfÔfÐfÐfÜˆx˜	Õ"Ó#¤sÐ+<¸WÕ+EÓ'FÖLÈ"ÔLÐLÑLÐLÐLØÐ?Ø¹EÓ!B¹E°q¤V¬A°­E£]Ò"2¹EÑ!BÀNÔTZÔ[\ÓT]Øð  QØð  gØð  iØð  Zð[€Hô ˆÕ×$Ñ$¤T§Z¢Z°ÀÔ%CÀdÕ%JÔKÜˆ…\×ÑÔÜˆ…]×ÑÔÜ×%Ñ%¤t§y¡y´$·(±(¼D¿O¹OÌTÏ]É]Ô\`×\kÑ\kÜ�[‰[œ$×*Ñ*¬D¯I©I´t·±Ì×H^ÑH^Ô`d×`kÑ`kÜ�\‰\œ4Ÿ<™<¬¯©¼$¿+¹+ÄtÇ}Á}ÔVZ×VdÑVdÔfj×f|Ñf|ð~€Eô 
×	Ñ	×	)Ñ	)¨%×	0Õ	0Ü—*’*œQ¨UÀÔFÀwÕO×UÑUÓWˆ÷ 
1äÐ#¨*Ô5€EØ€E„KÜ,/¯NªN¼1¿6¹6»8ÈsÕ,SÓTÑ,S qÐÕ Ò"Ñ,S€DÐTÜ‹w€HØ€DÜÐ 1°'Õ :¸HÀYÕ<O×PÑˆØ�d�|˜x¨�~Ô-Ð-Ð-Ü3<¸VÈKÕEXÐZbÓ3cÑ0ˆ
�B˜ '¨5ØÐ&<Õ=Ô=À%È8ÐTkÕKlÔBlÐlÐlÜ�H˜Q•K (¨1¥+Õ-×2Ñ2Ó4Ó5¸ÐBSÕ9TÔTÐTÐTÜ/5°b¸'À9Ó/MÑ,ˆ�l HÜ”a˜( 8Õ,¨YÕ7¸Õ?Õ?Ó@ÀHÈXÕDVÐW`ÕDaÐbjÕDkÔkÐkÐkÜ�~Š~˜h¬¯
ª
´5·:²:¼aÀ(È8ÕBTÐU^ÕB_Ð`fÕBgÕ>gÓ3h×3pÑ3pÐqtÓ3uÓ(v×wÒwÐwÐwÜ",¨R°¸7Ó"CÑˆˆW�c˜4Ü�gŠg”b—g’g˜c 1 cÓ*Ó+×2Ñ2°7Ó;ˆÜ�~Š~˜c H¨Q¥K°(¸1µ+Õ$=Ð">Õ?ÀÈHÐUVÍKÐZbÐcdÕZeÕLeÐJfÕAg×hÒhÐhÐhÜ  H¨c°7¸CÀÓFˆØŸ	™	¤"§*¡*Ó-°¸µ
Õ:¸WÀQ½ZÕGˆÜ—’˜Ÿ™¤4Ó(ˆÜ! " h°¸wÈÈuÓUˆ	Ü˜•\ V¨D¥\°FÕ%:Õ;ˆ
Ü�Š˜Ó×!Ñ! *Ô-ØˆÜ" 8¨IÕ#6×7‰IˆAˆvØ#Ð$9Õ:‰NˆB��B˜Ø�r˜"�u˜b ˜e�|Õ$×)Ñ)Ó+ˆDÜ�Y• F¨4¥L >°°1°#°TÐ!:Õ:ˆBÜ�OŠO˜DÓ!×&Ñ& rÔ*Ø˜LÕ)Ð*;Õ<‰FˆB�Ü!¤#§,¢,¨t´S×5GÑ5GÓ"HÈ"ÈbÓQˆHØ—]‘] 8°3¸uÈe�]ÓTÐUVÕWˆFØ—\‘\×&Ñ&×*Ñ*Ó,×2Ñ2Ó4ˆFÜ—J’J ˜w¨XÔ6°rÕ:ˆEØ�N‰N˜H f¨XÕ&6Ð8MÈvÐVkÕOlØ<¸fÐElÕ>mØ)¨6°,Õ+?Ð@PÕ+QÐRXÕ+YØ3°V¸LÕ5IÐJ[Õ5\Ð]cÕ5dØ-ÙZ_ó0aÙZ_ÐUVð 28¸¿¹ÄsÈ1ÃvÕ9NÐP]Ð_c×dqÑdqÔruÐvwÓrxÕdyÕ_zð  |Eõ  `FØ18¼%ÀÄsÈ1ÃvÅÓ:Oó1QÙZ_ñ0aà#¤S¨¯©¼Ó):Ó%;¸^ÌVÐTVËZðY÷ Zñ 8ð" 	�‰�T˜6 $�<¨°v¸lÕ7KÈWÔVYÐZd×ZpÑZpÔqrÓZsÓVtØ#¤V¨JÓ%7Ð9SÐU^Ø)¨7°I¸wðHô 	Iô ˆt‹9�q�=˜A×Ü�*œc $›i¨¸T×BÐBñO QôP ˆÕ×#Ñ#¤D§J¢J°Ð:^Ø0AÄ6Ì!ÈoÕJ]ÓC^Ø09¸8ÀIÕ;NÐPYÐ[_ð0aàijô%lànrõ%sö tùòu "C÷ 
1×	0Ð	0üò UùòF0as   Ç!i-
Ï3i2Ñjã%A+j"é2j	Ú__main__))Ú__doc__r±   rƒ   r‘   r�   r†   Úpathlibr   r‰   rÅ   r   r‹   ÚPILr   Úultralyticsr   Úultralytics.utilsr   Úr112_gunduz_species_retentionrš   Ú diatom_pilot.ude_scaleup_datasetr   Údiamorph_previewr   Úr112_gunduz_native_scenesr   Úr112_gunduz_overlap_pair_pilotr	   r
   Ú__file__ÚresolveÚparentsr–   r“   rŽ   r—   r³   r   r<   rð   Ú__name__© r=   r   Ú<module>r     sª   ðÙ GÛ 
Û Û Û 	Û Ý ã 
Û Û Ý Ý Ý $ã ,Ý 3Ý 'Ý +ß <áˆƒN×ÑÓ×$Ñ$ QÕ'€ØÐ0Õ0€ØÐ6Õ6€ÙÐ	-Ó.€ØÐ6Õ6€ò
#ò-ò,Ptðf ˆzÔÙ†Fñ r=   