+
    “ûk­  ã                   óú  € R 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 ]! ]4      P                  4       P                   P                   t]P$                  ! ]R,          P'                  4       4      R,          t]P$                  ! ]R,          P'                  4       4      R,          t]P$                  ! ]R	,          P'                  4       4      R,          t]	P.                  ! ^4       ]! R
4      tR t. t]! R@]]4       EF  w  ttt]]^,
          ,          t]R,          ]R,          u;8X  d   ]R,          8X  g   Q h Q h]! R]R R24      t ]PB                  ! ] PE                  4       4      PG                  4       t$]$]R,          8w  g   ]$]R,          8w  d	   ]%! R4      h]PL                  ! ]PN                  ! ] 4      PQ                  R4      PS                  RA]PT                  PV                  4      4      t,]P$                  ! ]! R4      ]R,          ^ ,          ,          P'                  4       4      t-. t.]R,           Fç  t/]0! R ]-R,           4       4      t1]Pd                  ! ]R,          ]R,          3]Pf                  4      t4]1R,           FW  t5]Pl                  ! ]4]Pn                  ! ]PL                  ! ]54      Pq                  RB^4      4      Ps                  R4      .^4       KY  	  ].Pu                  ]PR                  ! ]4RA]Pv                  R7      Ps                  ]<4      4       Ké  	  ]=! ]R,          R R 7      t>. . .t?]> EFN  t@]Pƒ                  ]P„                  ! ],]P†                  4      ]@R!,          RR"R#R$R%7      ^ ,          tD]DPŠ                  e"   ]F! ]DPŠ                  PŽ                  4      ^8w  d	   ]%! R&4      h]DPŠ                  PŽ                  ^ ,          P‘                  4       P                  4       Ps                  ]<4      tI]IP”                  ].^ ,          P”                  8w  d	   ]%! R'4      h]K! ].4       FU  w  tLtM]?]L,          Pu                  ]N! ]I]M,          PŸ                  4       ]I]M,          PŸ                  4       ,          4      4       KW  	  EKQ  	  R(R)R*R+]?R,]F! ]>4      /R-R)R.R+]R/,          R,]R0,          //tP]PP£                  4        F«  tR/ ]RR1&   RC F�  tS/ ]RR1,          ]T! ]S4      &   RD F‚  tU]! ]RR+,          ]U]S4      tVR4]W! ]U]RR,,          4      R5]X! ]V4      R6]K! ]V4       U Uu. uF"  w  rVf   RM]RR+,          V ,          V,          NK$  	  upp /]RR1,          ]T! ]S4      ,          ]T! ]U4      &   K„  	  KŸ  	  K­  	  ]Pu                  R]R,          R7]P/4       ]Y! ]R,          ]PPµ                  4        UUUUu/ uF>  w  r#Y#R1,          R8,          Pµ                  4        UUu/ uF  w  rEWER6,          bK  	  uppbK@  	  uppppR#R97       EK  	  ]R:,          t[][P¹                  R#R#R;7       ][R<,          P»                  ]P¼                  ! R=R2R3.R1. RDOR]/^R>7      R?,           4       R# u upp i u uppi u uppppi )EzçScore detector-prompted and grid-prompted masks with a common mask rule.

Uses frozen R25 detector boxes and L25 grid scores. Reference assignments are
posthoc evaluation only. Source image pixels and candidate masks stay in /tmp.
N)ÚPath)ÚImage)ÚSAMzresults/l24/overlap-audit.jsonÚoverlap_pairsz"results/r25/candidate-results.jsonÚrecordszresults/l25/grid-results.jsonz/tmp/mobile_sam.ptc           	      óö  a a€ \        V\        S ^ ,          4      4      pR.\        \        V4      4      ,           p\        P
                  ! V^R7       Uu. uFˆ  pV^ ,          e#   V^,          e   V^ ,          V^,          8w  g   K0  \        ;QJ d)    V V3R l\        V4       4       F  '       d   K   RM	  RM! V V3R l\        V4       4       4      '       g   K†  VNKŠ  	  pp\        VV 3R lR7      # u upi )é    N)Úrepeatc              3   óf   <"  € T F&  w  rVR J ;'       g    SV,          V,          S8¬  x € K(  	  R # 5i©N© )Ú.0ÚkÚjÚscoresÚ	thresholds   &  €€Úresearch/r26_common_budget.pyÚ	<genexpr>Úassign.<locals>.<genexpr>   s/   øé € ÐXÉ<Á4À1˜˜T˜	×>Ð> V¨A¥Y¨q¥\°YÑ%>Ô>Ë<ùs   ƒ1•1FTc                 ód   <€ \        R  V  4       4      \        V3R l\        V 4       4       4      3# )c              3   ó(   "  € T F  qR Jx € K
  	  R # 5ir   r   )r   r   s   & r   r   Ú+assign.<locals>.<lambda>.<locals>.<genexpr>   s   é € Ð+EÁ1¸a°T­MÃ1ùs   ‚c              3   óT   <"  € T F  w  rVf   K  SV,          V,          x € K  	  R # 5ir   r   )r   r   r   r   s   &  €r   r   r       s!   øé € ÐJ©L¡D A¸A”<�6˜!•9˜Q—<’<«Lùs   ƒ(�()ÚsumÚ	enumerate)Úar   s   &€r   Ú<lambda>Úassign.<locals>.<lambda>   s(   ø€ ¬Ñ+EÁ1Ó+EÓ(EÜÔJ¬I°a¬LÓJÓJñ(Ló    ©Úkey)	ÚminÚlenÚlistÚrangeÚ	itertoolsÚproductÚallr   Úmax)r   Úbudgetr   ÚnÚoptionsr   Úfeasibles   f&f    r   Úassignr-      sÄ   ù€ ÜˆF”C˜˜q�	“NÓ#€AØˆf”tœE !›H“~Õ%€GÜ$×,Ò,¨W¸QÕ?ó ZÑ?�aØ�a•D’L A a¥D¢L°A°aµD¸A¸a½D±Lô ç“CÕXÌ9ÐUVÌ<ÓX—C—C’CÕXÌ9ÐUVÌ<ÓX×X÷ �Ñ?€Hð Zô ˆxô Lô Mð MùòZs   Á-C6Â
C6ÂC6Â3%C6ÃC6Úfilenamez/tmp/diatom-l24-overlap/Ú02z.jpgÚimage_sha256z.Image differs from an earlier experiment inputÚRGBé   z/tmp/diatom-mask-cocoÚvariantsÚannotation_ids_first_variantc              #   óL   "  € T F  qR ,          \         8X  g   K  Vx € K  	  R# 5i)ÚidN)Úident)r   r   s   & r   r   r   /   s   é € ÐOÑ%: À½gÌÑ>NŸ!š!Ó%:ùs   ‚$š
$ÚannotationsÚheightÚwidthÚsegmentationÚint32)ÚinterpolationÚdetector_predictionsc                 ó   € V R ,          ) # )Ú
confidencer   )Úps   &r   r   r   4   s   € È!ÈLÍ/ÑIYr   r   ÚxyxyÚcpuTF)ÚbboxesÚimgszÚdeviceÚretina_masksÚverbosez,Expected one mask for each detector proposalzUnexpected mask shapeÚdetector_box_promptsÚrankingzYOLO confidencer   Ú
candidatesÚregular_grid_promptszMobileSAM mask qualityÚtarget_mask_iousÚafter_suppressionÚbudgetsç      à?ç      è?Ú
consideredÚmatched_indicesÚmatched_iousÚmethodsz0.5)Úflushzresults/r26)ÚparentsÚexist_okzcommon-budget.jsonÚmask_iou_thresholds)ÚindentÚ
)é   é   )r2   i@  éÿÿÿÿ)rP   rQ   )é   é
   é   )_Ú__doc__Úhashlibr%   ÚjsonÚpathlibr   Úcv2ÚnumpyÚnpÚtorchÚPILr   Úultralyticsr   Ú__file__ÚresolveÚparentÚROOTÚloadsÚ	read_textÚsource_rowsÚdetector_rowsÚ	grid_rowsÚset_num_threadsÚ	segmenterr-   r   ÚzipÚsource_indexÚdetectorÚgridÚrowÚpathÚsha256Ú
read_bytesÚ	hexdigestÚdigestÚ
ValueErrorÚasarrayÚopenÚconvertÚresizeÚ
ResamplingÚLANCZOSÚimageÚsourceÚrefsr7   ÚnextÚ
annotationÚzerosÚuint8ÚrawÚpolygonÚfillPolyÚrintÚreshapeÚastypeÚappendÚINTER_NEARESTÚboolÚsortedÚpredictionsr   Ú
predictionÚpredictÚcvtColorÚCOLOR_RGB2BGRÚresultÚmasksr"   ÚdatarC   ÚmaskÚshaper   r   ÚrefÚfloatr   rU   ÚvaluesÚmethodr   Ústrr)   Úpairr!   r#   ÚprintÚitemsÚoutÚmkdirÚ
write_textÚdumps)r   r   Únamer¦   ÚbÚvs   000000r   Ú<module>r²      sð  ðñó
 Û Û Ý ã 
Û Û Ý Ý áˆHƒ~×ÑÓ×&Ñ&×-Ñ-€Ø�jŠj˜$Ð!AÕA×LÑLÓNÓOÐP_Õ`€Ø—
’
˜DÐ#GÕG×RÑRÓTÓUÐV_Õ`€Ø�JŠJ˜Ð>Õ>×IÑIÓKÓLÈYÕW€	Ø × Ò �aÔ ÙÐ$Ó%€	òMð €Ù$'¨°¸y×$IÑ €L�(˜DØ
�l QÕ&Õ
'€CØˆz�?˜h zÕ2ÖF°d¸:Õ6FÔFÐFÑFÐFÐFÙÐ*¨<¸Ð*;¸4Ð@ÓA€DØ�^Š^˜DŸO™OÓ-Ó.×8Ñ8Ó:€FØ�˜.Õ)Ô)¨V°t¸NÕ7KÔ-KÙÐIÓJÐJØ�JŠJ�u—z’z $Ó'×/Ñ/°Ó6×=Ñ=¸jÈ%×JZÑJZ×JbÑJbÓcÓd€EØ�ZŠZ™Ð5Ó6¸¸Z½ÈÕ9KÕK×VÑVÓXÓY€FØ€DØÐ3×4Ð4ˆÙÑO V¨MÖ%:ÓOÓOˆ
Ø�hŠh˜˜H� s¨7¥|Ð4°b·h±hÓ?ˆØ! .×1Ð1ˆGØ�LŠL˜˜rŸwšw r§z¢z°'Ó':×'BÑ'BÀ2ÀqÓ'IÓJ×QÑQÐRYÓZÐ[Ð]^Ö_ñ 2à�‰�C—J’J˜s J¸c×>OÑ>OÔP×WÑWÐX\Ó]Ö^ñ 5ñ ˜Ð"8Õ9Ñ?YÔZ€KØ�"ˆX€FÜ!ˆ
Ø×"Ñ" 3§<¢<°°s×7HÑ7HÓ#IÐR\Ð]cÕRdØ %°dÀEð #ó KØKLõNˆà�<‰<Ò¡3 v§|¡|×'8Ñ'8Ó#9¸QÔ#>ÙÐKÓLÐLØ�|‰|× Ñ  Õ#×'Ñ'Ó)×/Ñ/Ó1×8Ñ8¸Ó>ˆØ�:‰:˜˜a�Ÿ™Ô&ÙÐ4Ó5Ð5Ù –o‰FˆAˆsØ�1�I×Ñ™U D¨3¥J×#3Ñ#3Ó#5¸À½×8HÑ8HÓ8JÕ#JÓKÖLô &ñ "ð &¨	Ð3DÀhÐPVØ'3±S¸Ó5Eð(Gà%¨	Ð3KÈXÐW[Ð\nÕWoØ(4°dÐ;NÕ6Oð(QðR€Gð —.‘.Ö"ˆØˆˆyÑÛ"ˆIØ02ˆF�9Õ™c )›nÑ-Û%�Ù˜f XÕ.°¸	ÓB�à ¡# f¨f°\Õ.BÓ"CØ%¡t¨D£zØ"Ñ_hÐimÔ_nÔ$oÑ_nÑW[ÐWX¨QªY¡T¸FÀ8Õ<LÈQÕ<OÐPQÕ<RÒ%RÑ_nÒ$oðBq��yÕ!¡# i£.Õ1±#°f³+Ó>ó &ó #ñ #ð ‡N�N�J  J¥°¸GÐDÔEÙ	ˆ#ˆj�/Ø07·±´öAÙ0?¡ ð !È9ÕDUÐV[ÕD\×DbÑDbÔDdÔ"eÑDd¹D¸A 1¨Õ&7Ò#7ÑDdÒ"eÒeÙ0?ôAØHL÷Nð NñW %JðZ ˆ]Õ€Ø ‡	�	�$ €	Ô &ØÐÕ× 'Ñ '¨¯
ª
Ð4IÈBÐPSÈ9ØŠ{˜I wð40Ø89ô);Ø=Aõ)Bö Cùó %pùã"eùõ As   Ô*(Y)Ö;(Y5×#Y/×7Y5Ù/Y5