GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 🆕 Add Virchow2 distilled model configs by Jiaqi-Lv · Pull Request #1131 · TissueImageAnalytics/tiatoolbox

Conversation

@Jiaqi-Lv

@Jiaqi-Lv Jiaqi-Lv commented Sep 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Summary

This pull request adds the SegFormer-B5 tissue segmentation models distilled from Virchow2, plus the inference and export fixes those models need.

The models come from Computationally Efficient Pathology Segmentation using Knowledge Distillation from Foundation Models.

New model configs

pretrained_model.yaml registers five checkpoints from TIACentre/Virchow2_Distilled_Segmentation_Models:

Model Dataset Classes Resolution Patch
segformerb5_distilled_PUMA_1/2/5 PUMA 6 (background, stroma, blood vessels, tumour, epidermis, necrosis) 1.14 mpp 224, stride 112
segformerb5_distilled_IGNITE_1 IGNITE 7 (unknown, background, tumour, stroma, necrosis, macrophages, rest) 0.5 mpp 448, stride 224
segformerb5_distilled_BEETLE_1 BEETLE 5 (unknown, other, non-invasive epithelium, invasive epithelium, necrosis) 1.0 mpp 448, stride 224

SegFormer inference

  • Segformer takes an optional class_dict.
  • Forward no longer relies on the Hugging Face segmentation head's hooks. Those hooks are shared across DataParallel replicas and feed the same feature map into every decoder projection. The model now runs each encoder stage directly and passes those hidden states to decode_head.
  • load_state_dict unwraps checkpoints nested under a model key.
  • postproc accepts a Dask array, runs the morphology on a computed array, and returns a Dask array so the engine can write the mask to Zarr.

QuPath export

Semantic-segmentation GeoJSON now uses contour hierarchy, so a nested class becomes a hole in the surrounding polygon. Classes with no pixels are skipped.

Example

Notebook 06-semantic-segmentation runs segformerb5_distilled_PUMA_1 on a whole-slide image, writes an annotation store, and shows the overlay in TIAViz.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

shaneahmed reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@Jiaqi-Lv
add Virchow2 distilled model configs
a326685
@codecov

codecov Bot commented Sep 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.91%. Comparing base (c4a5afa) to head (eca8405).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1131   +/-   ##
========================================
  Coverage    99.91%   99.91%           
========================================
  Files          117      117           
  Lines        13587    13603   +16     
  Branches      1624     1628    +4     
========================================
+ Hits         13576    13592   +16     
  Misses           5        5           
  Partials         6        6           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Jiaqi-Lv and others added 2 commits September 5, 2026 16:56
@Jiaqi-Lv
improve test coverage
b5b8a1c
@Jiaqi-Lv
Merge branch 'develop' into Add-Virchow2-distilled-models
f69b22f
@shaneahmed shaneahmed assigned Jiaqi-Lv Sep 11, 2026
@shaneahmed shaneahmed added this to the Release v2.1.4 milestone Sep 11, 2026
@shaneahmed shaneahmed added the enhancement New feature or request label Sep 11, 2026
shaneahmed and others added 3 commits September 11, 2026 11:25
@shaneahmed
Merge branch 'develop' into Add-Virchow2-distilled-models
6e4df43
@shaneahmed
Merge branch 'develop' into Add-Virchow2-distilled-models
6e73201
@Jiaqi-Lv
update notebook WIP
0256e0f
@review-notebook-app

review-notebook-app Bot commented Oct 8, 2026

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

pre-commit-ci Bot and others added 8 commits October 8, 2026 10:21
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
f13ad91
for more information, see https://pre-commit.ci
@shaneahmed
Merge branch 'develop' into Add-Virchow2-distilled-models
7de1d53
@Jiaqi-Lv
update notebook example(WIP)
23af26e
@Jiaqi-Lv
Merge branch 'Add-Virchow2-distilled-models' of https://github.com/Ti…
845ee43
…ssueImageAnalytics/tiatoolbox into Add-Virchow2-distilled-models
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
4cd5632
for more information, see https://pre-commit.ci
@Jiaqi-Lv
update notebook WIP
f9fc926
@Jiaqi-Lv
Merge branch 'develop' into Add-Virchow2-distilled-models
1589aed
@Jiaqi-Lv
update notebook
3d88f26
@Jiaqi-Lv
Jiaqi-Lv marked this pull request as ready for review October 15, 2026 16:58
wildsquirrel wildsquirrel
add catalog to pretrained models
c15d4fe
shaneahmed
shaneahmed reviewed Oct 30, 2026
View reviewed changes
Comment thread tests/models/test_arch_segformer.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

shaneahmed
shaneahmed reviewed Oct 30, 2026
View reviewed changes
Comment thread tiatoolbox/data/pretrained_model.yaml Resolved

Uh oh!

There was an error while loading. Please reload this page.

shaneahmed
shaneahmed reviewed Oct 30, 2026
View reviewed changes
Comment thread tiatoolbox/data/pretrained_model.yaml Resolved

Uh oh!

There was an error while loading. Please reload this page.

wildsquirrel and others added 3 commits November 5, 2026 18:01
wildsquirrel wildsquirrel
address comments
a6dabf3
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
887644d
for more information, see https://pre-commit.ci
@shaneahmed
Merge branch 'develop' into Add-Virchow2-distilled-models
eca8405
@Jiaqi-Lv

Jiaqi-Lv commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

TODO: Update names/links to the new paper.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@shaneahmed shaneahmed shaneahmed left review comments

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@Jiaqi-Lv Jiaqi-Lv

Labels

enhancement New feature or request

Projects

None yet

Milestone

Release v2.1.4

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Jiaqi-Lv @shaneahmed
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.