-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SAM2: image pipeline #358
Open
parthchadha
wants to merge
16
commits into
main
Choose a base branch
from
sam2-image
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
SAM2: image pipeline #358
+4,771
−3
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parthchadha
force-pushed
the
sam2-image
branch
from
November 12, 2024 15:24
51971a1
to
4fe3f2d
Compare
parthchadha
force-pushed
the
sam2-image
branch
from
November 12, 2024 15:26
4fe3f2d
to
cdc57d1
Compare
parthchadha
force-pushed
the
sam2-image
branch
from
November 12, 2024 17:57
474b03d
to
f0149c7
Compare
parthchadha
force-pushed
the
sam2-image
branch
from
November 12, 2024 23:36
31cf559
to
423d2b3
Compare
parthchadha
force-pushed
the
sam2-image
branch
from
November 25, 2024 22:43
6b9bfed
to
08e9dd5
Compare
parthchadha
force-pushed
the
sam2-image
branch
from
November 25, 2024 23:20
08e9dd5
to
1ddeb22
Compare
tripy/examples/segment-anything-model-v2/sam2/modeling/memory_encoder.py
Outdated
Show resolved
Hide resolved
tripy/examples/segment-anything-model-v2/sam2/modeling/sam2_utils.py
Outdated
Show resolved
Hide resolved
tripy/tests/test_examples.py
Outdated
Comment on lines
100
to
116
specs = [] | ||
placeholder_regex = r"{(\d+\.?\d*)±(\d+)%}" | ||
pattern = expected_output | ||
|
||
# Replace tolerance patterns with more flexible capture group | ||
matches = list(re.finditer(placeholder_regex, pattern)) | ||
for match in matches: | ||
specs.append((match.group(1), match.group(2))) | ||
pattern = pattern.replace(match.group(0), r"(\d+\.?\d*)", 1) | ||
|
||
# Escape parentheses but not our capture group | ||
pattern = pattern.replace("(", r"\(") | ||
pattern = pattern.replace(")", r"\)") | ||
pattern = pattern.replace(r"\(\d+\.?\d*\)", r"(\d+\.?\d*)") | ||
|
||
# Make whitespace flexible | ||
pattern = pattern.replace(" ", r"\s+") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand what's happening here. Can we encode the flexibility into the regex itself?
Very cool tolerance mechanism for example testing! |
parthchadha
force-pushed
the
sam2-image
branch
from
November 27, 2024 16:50
d6b893e
to
f1eb3e3
Compare
…y_encoder; fix test_with_tolerance function
parthchadha
force-pushed
the
sam2-image
branch
from
November 27, 2024 16:53
f1eb3e3
to
e2690ce
Compare
parthchadha
force-pushed
the
sam2-image
branch
from
November 27, 2024 21:00
390625e
to
79e1f01
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds Tripy implementation of SAM2.
Work done by @yizhuoz004, @akhilg-nv, @parthchadha.