Skip to content

Use TRIDENT patch encoder factory in HEST benchmark and remove legacy bench model zoo - #132

Merged
guillaumejaume merged 14 commits into
mainfrom
gja/trident
Mar 9, 2026
Merged

guillaumejaume merged 14 commits into
mainfrom
gja/trident

Conversation

@guillaumejaume

@guillaumejaume guillaumejaume commented Mar 4, 2026 •

Copy link
Copy Markdown
Collaborator

This PR migrates HEST benchmark encoder loading to TRIDENT’s patch encoder stack and removes redundant HEST-specific model-loading code.

What changed

  • Switched benchmark encoder construction to TRIDENT (encoder_factory) instead of HEST’s local cpath_model_zoo.
  • Updated benchmark encoder names/configuration to TRIDENT-native names (e.g. hibou_l, kaiko-vitb8, etc.).
  • Removed HEST-local checkpoint registry usage (src/hest/bench/local_ckpts.json) and delegated model weight resolution to TRIDENT.
  • Improved benchmark metric readability
  • Updated HEST dependency to install TRIDENT with patch-encoder extras (trident[patch-encoders]) so required optional encoder deps (e.g. CONCH/MUSK) are available.
  • Pinned transformers to <5 to fix Hibou-L loading incompatibility (transformers.onnx import issue with v5).

@pauldoucet Main todos:

  • put trident on pypi as trident-wsi (version 0.2.4 is ready, see PR on trident repo)
  • test core functions of HEST (basis tests look ok)
  • re-run bench on all trident models (running now on my end)

@guillaumejaume guillaumejaume changed the title wip: deprecate hestcore + use trident patch encoder factory Use TRIDENT patch encoder factory in HEST benchmark and remove legacy bench model zoo Mar 4, 2026
@pauldoucet

Copy link
Copy Markdown
Collaborator

Hi @guillaumejaume, thanks for the changes :) !

I'll test on my end ASAP, probably this weekend. There are quite a lot changes, it's probable that something will break

@guillaumejaume

Copy link
Copy Markdown
Collaborator Author

@pauldoucet, I re-ran the benchmark on all trident patch encoders, results are visible in the updated README. Custom patch encoders are also working fine. Segmentation and patching seem fine. Tutorials run ok. But there are small things that I don't know.

Feel free to lmk what should be tested.

@pauldoucet pauldoucet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me! If the tutorials already run, that's a great start

I think to be a 100% sure, maybe trying to process a Xenium or Visium sample from start to finish and compare with existing samples on HF could help (section Adding new samples to HEST)

Comment thread src/hest/HESTData.py
import traceback
traceback.print_exc()
self.adata.__dict__['_raw'].__dict__['_var'] = self.adata.__dict__['_raw'].__dict__['_var'].rename(columns={'_index': 'features'})
self.adata.write(os.path.join(path, 'aligned_adata.h5ad'))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the previous workaround worked well, have you encountered another issue here?

@pauldoucet

Copy link
Copy Markdown
Collaborator

@guillaumejaume thanks a lot for the changes! I also tried processing a mock Xenium sample, seems like it's working fine.

For some reason, the segmentation CI test is hanging, I just commented it out for now.

Feel free to merge if you've already pushed all your changes

@pauldoucet
pauldoucet marked this pull request as ready for review March 8, 2026 21:21
@guillaumejaume
guillaumejaume merged commit 6a8a9b8 into main Mar 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants