Skip to content

Add Encoder-only Mask Transformer (EoMT) (except integration test(s), pre- and post- processing and training code) - #37392

Closed
tommiekerssies wants to merge 3 commits into
huggingface:mainfrom
tommiekerssies:add-eomt-model
Closed

Add Encoder-only Mask Transformer (EoMT) (except integration test(s), pre- and post- processing and training code)#37392
tommiekerssies wants to merge 3 commits into
huggingface:mainfrom
tommiekerssies:add-eomt-model

Conversation

@tommiekerssies

@tommiekerssies tommiekerssies commented Apr 9, 2025

Copy link
Copy Markdown

See #37171

As stated in the title, the integration test is still needed. The pre- and post- processing and training code is preferably for a later PR.

@github-actions
github-actions Bot marked this pull request as draft April 9, 2025 12:22
@github-actions

github-actions Bot commented Apr 9, 2025

Copy link
Copy Markdown
Contributor

Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the Ready for review button (at the bottom of the PR page). This will assign reviewers and trigger CI.

@tommiekerssies tommiekerssies changed the title Add Encoder-only Mask Transformer (EoMT) (except integration test, image processors, training code) Add Encoder-only Mask Transformer (EoMT) (except pre- and post- processing and training code) Apr 9, 2025
@tommiekerssies tommiekerssies changed the title Add Encoder-only Mask Transformer (EoMT) (except pre- and post- processing and training code) Add Encoder-only Mask Transformer (EoMT) (except integration test(s), pre- and post- processing and training code) Apr 9, 2025
@Rocketknight1

Copy link
Copy Markdown
Member

cc @NielsRogge @qubvel

@tommiekerssies
tommiekerssies marked this pull request as ready for review April 11, 2025 20:27
@tommiekerssies

Copy link
Copy Markdown
Author

Unfortunately, I do not have more time to work on this in the coming days. Not sure if this can already be reviewed/merged?

@qubvel

qubvel commented Apr 11, 2025

Copy link
Copy Markdown
Contributor

Hey @tommiekerssies, thanks a lot for opening the PR!

Unfortunately, it's not quite in a state where we can merge it into Transformers just yet. To move forward, the model should at least:

  1. Be usable end-to-end — including both pre- and post-processing (it looks like Mask2FormerImageProcessor might be compatible?).

  2. Follow Transformers conventions: clear docstrings, use of common modules, no one-letter variable names (you'll probably want to make use of the modular Transformers structure for this).

  3. Include a conversion script, common model tests, and integration tests.

Totally understand if you don’t have the bandwidth in the coming days — we’d love for you to pick it up again later if possible. Alternatively, we can add the “contribution welcome” label in case someone from the community wants to continue your work.

In any case, it’s a great model and we’d be happy to see it land in Transformers!

@tommiekerssies

Copy link
Copy Markdown
Author

Hey @tommiekerssies, thanks a lot for opening the PR!

Unfortunately, it's not quite in a state where we can merge it into Transformers just yet. To move forward, the model should at least:

  1. Be usable end-to-end — including both pre- and post-processing (it looks like Mask2FormerImageProcessor might be compatible?).
  2. Follow Transformers conventions: clear docstrings, use of common modules, no one-letter variable names (you'll probably want to make use of the modular Transformers structure for this).
  3. Include a conversion script, common model tests, and integration tests.

Totally understand if you don’t have the bandwidth in the coming days — we’d love for you to pick it up again later if possible. Alternatively, we can add the “contribution welcome” label in case someone from the community wants to continue your work.

In any case, it’s a great model and we’d be happy to see it land in Transformers!

Thanks for the feedback, much appreciated.

Let’s go ahead and add the “contribution welcome” label for now. If someone from the community is interested in picking this up, they can refer to our implementation at https://github.com/tue-mps/eomt.

Regarding pre- and post-processing: all our checkpoints on Hugging Face are based on DINOv2, and the model expects ImageNet normalization.
For panoptic and instance segmentation, we use padded inference: the longer side is resized to the target input size, the shorter side is zero-padded to form a square of shape (image_size, image_size), and normalization is applied afterward.
For semantic segmentation, we use sliding-window inference: the shorter side is resized to the target input size, the image is split into (potentially overlapping) crops of (image_size, image_size), and each crop is normalized individually.

After the forward pass, the logits are mapped back to the original image size. Mask2Former post-processing can then be reused to convert the mask and class logits into final predictions for each task.

Happy to support anyone who wants to continue the integration. I may also return to it myself if time allows.

@qubvel qubvel added New model Good Second Issue Issues that are more difficult to do than "Good First" issues - give it a try if you want! Vision contributions-welcome labels Apr 12, 2025
@tommiekerssies tommiekerssies mentioned this pull request Apr 17, 2025
2 tasks
@yaswanth19

Copy link
Copy Markdown
Contributor

Hey @tommiekerssies, We can close this PR 😄

@qubvel qubvel closed this Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributions-welcome Good Second Issue Issues that are more difficult to do than "Good First" issues - give it a try if you want! New model Vision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants