Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SVLT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ALMF
SVLT
Commits
19261090
Commit
19261090
authored
6 months ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Implemented segmentation IOU
parent
88cd7cae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
model_server/base/roiset.py
+5
-2
5 additions, 2 deletions
model_server/base/roiset.py
tests/base/test_roiset.py
+2
-1
2 additions, 1 deletion
tests/base/test_roiset.py
with
7 additions
and
3 deletions
model_server/base/roiset.py
+
5
−
2
View file @
19261090
...
...
@@ -189,9 +189,12 @@ def filter_df_overlap_seg(df: pd.DataFrame) -> pd.DataFrame:
sl2
=
np
.
s_
[(
roi2
.
y0
-
ey0
):
(
roi2
.
y1
-
ey0
),
(
roi2
.
x0
-
ex0
):
(
roi2
.
x1
-
ex0
)]
emask
[
sl1
]
=
roi1
.
binary_mask
emask
[
sl2
]
=
emask
[
sl2
]
+
roi2
.
binary_mask
return
np
.
any
(
emask
>
1
)
return
emask
dfbb
[
'
seg_overlaps
'
]
=
dfbb
.
apply
(
_overlap_seg
,
axis
=
1
)
emasks
=
dfbb
.
apply
(
_overlap_seg
,
axis
=
1
)
dfbb
[
'
seg_overlaps
'
]
=
emasks
.
apply
(
lambda
x
:
np
.
any
(
x
>
1
))
dfbb
[
'
seg_intersec
'
]
=
emasks
.
apply
(
lambda
x
:
(
x
==
2
).
sum
())
dfbb
[
'
seg_iou
'
]
=
emasks
.
apply
(
lambda
x
:
(
x
==
2
).
sum
()
/
(
x
>
0
).
sum
())
return
dfbb
def
make_df_from_object_ids
(
acc_raw
,
acc_obj_ids
,
expand_box_by
)
->
pd
.
DataFrame
:
...
...
This diff is collapsed.
Click to expand it.
tests/base/test_roiset.py
+
2
−
1
View file @
19261090
...
...
@@ -692,4 +692,5 @@ class TestRoiSetPolygons(BaseTestRoiSetMonoProducts, unittest.TestCase):
})
res
=
filter_df_overlap_seg
(
df
)
self
.
assertTrue
((
res
.
loc
[
res
.
seg_overlaps
,
:].
index
==
[
1
,
2
]).
all
())
\ No newline at end of file
self
.
assertTrue
((
res
.
loc
[
res
.
seg_overlaps
,
:].
index
==
[
1
,
2
]).
all
())
self
.
assertTrue
((
res
.
loc
[
res
.
seg_overlaps
,
'
seg_iou
'
]
==
0.4
).
all
())
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment