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
5617a733
Commit
5617a733
authored
3 months ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Removed min_sobel, which was there for debugging
parent
555ac744
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
+3
-3
3 additions, 3 deletions
model_server/base/roiset.py
tests/base/test_roiset.py
+4
-1
4 additions, 1 deletion
tests/base/test_roiset.py
with
7 additions
and
4 deletions
model_server/base/roiset.py
+
3
−
3
View file @
5617a733
...
@@ -945,7 +945,7 @@ class RoiSet(object):
...
@@ -945,7 +945,7 @@ class RoiSet(object):
ph
,
pw
,
pc
,
pz
=
patch3d
.
shape
ph
,
pw
,
pc
,
pz
=
patch3d
.
shape
# make a 3d patch
# make a 3d patch
if
make_3d
or
not
expanded
:
if
make_3d
:
patch
=
patch3d
patch
=
patch3d
# make a 2d patch, find optimal z-position determined by focus_metric function on each channel separately
# make a 2d patch, find optimal z-position determined by focus_metric function on each channel separately
...
@@ -1166,7 +1166,7 @@ class RoiSet(object):
...
@@ -1166,7 +1166,7 @@ class RoiSet(object):
def
_poly_from_mask
(
roi
):
def
_poly_from_mask
(
roi
):
mask
=
roi
.
binary_mask
mask
=
roi
.
binary_mask
if
len
(
mask
.
shape
)
!=
2
:
if
len
(
mask
.
shape
)
!=
2
:
raise
Patch
Mask
ShapeError
(
f
'
Patch mask needs to be two dimensions to fit a polygon
'
)
raise
PatchShapeError
(
f
'
Patch mask needs to be two dimensions to fit a polygon
'
)
# label and fill holes
# label and fill holes
labeled
=
label
(
mask
)
labeled
=
label
(
mask
)
...
@@ -1402,7 +1402,7 @@ class MissingSegmentationError(Error):
...
@@ -1402,7 +1402,7 @@ class MissingSegmentationError(Error):
pass
pass
class
Patch
Mask
ShapeError
(
Error
):
class
PatchShapeError
(
Error
):
pass
pass
...
...
This diff is collapsed.
Click to expand it.
tests/base/test_roiset.py
+
4
−
1
View file @
5617a733
...
@@ -125,6 +125,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
...
@@ -125,6 +125,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
draw_bounding_box
=
True
,
draw_bounding_box
=
True
,
expanded
=
True
,
expanded
=
True
,
pad_to
=
256
,
pad_to
=
256
,
make_3d
=
False
,
)
)
df
=
roiset
.
get_df
()
df
=
roiset
.
get_df
()
for
f
in
se_res
:
for
f
in
se_res
:
...
@@ -133,6 +134,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
...
@@ -133,6 +134,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
roi_q
=
df
.
loc
[
df
.
label
==
la
,
:]
roi_q
=
df
.
loc
[
df
.
label
==
la
,
:]
self
.
assertEqual
(
len
(
roi_q
),
1
)
self
.
assertEqual
(
len
(
roi_q
),
1
)
self
.
assertEqual
((
256
,
256
),
acc
.
hw
)
self
.
assertEqual
((
256
,
256
),
acc
.
hw
)
self
.
assertEqual
(
1
,
acc
.
nz
)
def
test_make_tight_2d_patches
(
self
):
def
test_make_tight_2d_patches
(
self
):
roiset
=
self
.
_make_roi_set
()
roiset
=
self
.
_make_roi_set
()
...
@@ -140,7 +142,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
...
@@ -140,7 +142,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
se_res
=
roiset
.
export_patches
(
se_res
=
roiset
.
export_patches
(
where
,
where
,
draw_bounding_box
=
True
,
draw_bounding_box
=
True
,
expanded
=
False
expanded
=
False
,
)
)
df
=
roiset
.
get_df
()
df
=
roiset
.
get_df
()
for
f
in
se_res
:
# all exported files are same shape as bounding boxes in RoiSet's datatable
for
f
in
se_res
:
# all exported files are same shape as bounding boxes in RoiSet's datatable
...
@@ -150,6 +152,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
...
@@ -150,6 +152,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
self
.
assertEqual
(
len
(
roi_q
),
1
)
self
.
assertEqual
(
len
(
roi_q
),
1
)
roi
=
roi_q
.
iloc
[
0
]
roi
=
roi_q
.
iloc
[
0
]
self
.
assertEqual
((
roi
.
h
,
roi
.
w
),
acc
.
hw
)
self
.
assertEqual
((
roi
.
h
,
roi
.
w
),
acc
.
hw
)
self
.
assertEqual
(
1
,
acc
.
nz
)
def
test_make_expanded_3d_patches
(
self
):
def
test_make_expanded_3d_patches
(
self
):
roiset
=
self
.
_make_roi_set
()
roiset
=
self
.
_make_roi_set
()
...
...
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