Marlin Lee commited on
Commit
e31ffd7
·
1 Parent(s): 52a4c8b

Sync explorer_app.py and clip_utils.py from main repo

Browse files
Files changed (1) hide show
  1. scripts/explorer_app.py +8 -5
scripts/explorer_app.py CHANGED
@@ -32,9 +32,9 @@ Launch:
32
  --data ../explorer_data_d32000_k160_val.pt \
33
  --image-dir /scratch.global/lee02328/val \
34
  --extra-image-dir /scratch.global/lee02328/coco/val2017 \
35
- --primary-label "Final layer (d=32K)" \
36
  --compare-data ../explorer_data_18.pt \
37
- --compare-labels "Layer 18 (d=20K)"
38
 
39
  Then SSH tunnel: ssh -L 5006:<node>:5006 <user>@<login-node>
40
  Open: http://localhost:5006/explorer_app
@@ -594,7 +594,7 @@ def make_image_grid_html(images_info, title, cols=9):
594
  return html
595
 
596
 
597
- def make_compare_aggregations_html(top_infos, mean_infos, p75_infos, feat, n_each=6):
598
  """Figure-ready side-by-side comparison of the first two aggregation methods.
599
 
600
  Only Top (Max Activation) and Mean Activation are shown so that a screenshot
@@ -618,7 +618,9 @@ def make_compare_aggregations_html(top_infos, mean_infos, p75_infos, feat, n_eac
618
  'padding:16px 20px 14px 20px;display:inline-block">'
619
  # Title row
620
  f'<div style="font-size:13px;font-weight:bold;color:#222;margin-bottom:14px;'
621
- f'letter-spacing:0.1px">Feature {feat}</div>'
 
 
622
  '<div style="display:flex;gap:24px;align-items:flex-start">'
623
  )
624
 
@@ -1033,7 +1035,8 @@ def update_feature_display(feature_idx):
1033
 
1034
  # Side-by-side aggregation comparison (paper-ready screenshot view)
1035
  compare_agg_div.text = make_compare_aggregations_html(
1036
- heatmap_infos, mean_hm_infos, p75_hm_infos, feat)
 
1037
 
1038
  status_div.text = _status_html('ok', f'&#x2713; Feature {feat} ready.')
1039
  _update_view_visibility()
 
32
  --data ../explorer_data_d32000_k160_val.pt \
33
  --image-dir /scratch.global/lee02328/val \
34
  --extra-image-dir /scratch.global/lee02328/coco/val2017 \
35
+ --primary-label "DINOv3 L24 Spatial (d=32K)" \
36
  --compare-data ../explorer_data_18.pt \
37
+ --compare-labels "DINOv3 L18 Spatial (d=20K)"
38
 
39
  Then SSH tunnel: ssh -L 5006:<node>:5006 <user>@<login-node>
40
  Open: http://localhost:5006/explorer_app
 
594
  return html
595
 
596
 
597
+ def make_compare_aggregations_html(top_infos, mean_infos, p75_infos, feat, n_each=6, model_label=None):
598
  """Figure-ready side-by-side comparison of the first two aggregation methods.
599
 
600
  Only Top (Max Activation) and Mean Activation are shown so that a screenshot
 
618
  'padding:16px 20px 14px 20px;display:inline-block">'
619
  # Title row
620
  f'<div style="font-size:13px;font-weight:bold;color:#222;margin-bottom:14px;'
621
+ f'letter-spacing:0.1px">'
622
+ + (f'{model_label} — ' if model_label else '')
623
+ + f'Feature {feat}</div>'
624
  '<div style="display:flex;gap:24px;align-items:flex-start">'
625
  )
626
 
 
1035
 
1036
  # Side-by-side aggregation comparison (paper-ready screenshot view)
1037
  compare_agg_div.text = make_compare_aggregations_html(
1038
+ heatmap_infos, mean_hm_infos, p75_hm_infos, feat,
1039
+ model_label=_all_datasets[_active[0]]['label'])
1040
 
1041
  status_div.text = _status_html('ok', f'&#x2713; Feature {feat} ready.')
1042
  _update_view_visibility()