Skip to content

[Relax][TFLite] Add NON_MAX_SUPPRESSION_V5 support#19349

Merged
tlopex merged 2 commits into
apache:mainfrom
rknastenka:main
Apr 4, 2026
Merged

[Relax][TFLite] Add NON_MAX_SUPPRESSION_V5 support#19349
tlopex merged 2 commits into
apache:mainfrom
rknastenka:main

Conversation

@rknastenka

@rknastenka rknastenka commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Partially resolves #18928

to run the tests:

pytest tests/python/relax/test_frontend_tflite.py -v -k "nms"
image

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request implements the NON_MAX_SUPPRESSION_V5 operator in the TFLite frontend for TVM Relax, replacing a previous placeholder with a functional implementation and adding comprehensive tests. The feedback highlights that the output tensors should be truncated to max_output_size to ensure shape consistency with TFLite's behavior. Additionally, it is recommended to use the actual number of input boxes as the upper bound for index clipping to improve memory safety, and to update the IR verification tests to assert the correct output shapes based on the maximum output size.

Comment thread python/tvm/relax/frontend/tflite/tflite_frontend.py
Comment thread tests/python/relax/test_frontend_tflite.py Outdated

@tlopex tlopex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thanks!

@tlopex tlopex merged commit 28aac47 into apache:main Apr 4, 2026
10 checks passed
Aharrypotter pushed a commit to Aharrypotter/tvm that referenced this pull request Apr 10, 2026
Partially resolves apache#18928


to run the tests:
```bash
pytest tests/python/relax/test_frontend_tflite.py -v -k "nms"
```
<img width="728" height="44" alt="image"
src="https://github.com/user-attachments/assets/fbd4092a-bc7f-459d-8d51-b0ef926b241f"
/>
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.

[Tracking Issue] Add missing vision/image operators

2 participants