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
1263a4e6
Commit
1263a4e6
authored
11 months ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Allow None as an argument to rgb_overlay_channels, indicating export of mono patches
parent
2bbd571d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
model_server/base/roiset.py
+1
-1
1 addition, 1 deletion
model_server/base/roiset.py
tests/test_roiset.py
+30
-1
30 additions, 1 deletion
tests/test_roiset.py
with
31 additions
and
2 deletions
model_server/base/roiset.py
+
1
−
1
View file @
1263a4e6
...
...
@@ -28,7 +28,7 @@ class PatchParams(BaseModel):
draw_mask
:
bool
=
False
rescale_clip
:
float
=
0.001
focus_metric
:
str
=
'
max_sobel
'
rgb_overlay_channels
:
List
[
Union
[
int
,
None
]]
=
[
None
,
None
,
None
]
rgb_overlay_channels
:
Union
[
List
[
Union
[
int
,
None
]]
,
None
]
=
None
rgb_overlay_weights
:
List
[
float
]
=
[
1.0
,
1.0
,
1.0
]
pad_to
:
int
=
256
expanded
:
bool
=
False
...
...
This diff is collapsed.
Click to expand it.
tests/test_roiset.py
+
30
−
1
View file @
1263a4e6
...
...
@@ -428,9 +428,38 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa
self
.
assertEqual
(
pacc
.
hw
,
(
256
,
256
))
print
(
'
res
'
)
def
test_run_export_mono_2d_patch
(
self
):
p
=
RoiSetExportParams
(
**
{
'
patches_2d
'
:
{
'
draw_bounding_box
'
:
False
,
'
draw_mask
'
:
False
,
'
expanded
'
:
True
,
'
pad_to
'
:
256
,
'
rgb_overlay_channels
'
:
None
,
},
})
self
.
assertTrue
(
hasattr
(
p
.
patches_2d
,
'
pad_to
'
))
self
.
assertTrue
(
hasattr
(
p
.
patches_2d
,
'
expanded
'
))
where
=
output_path
/
'
run_exports_mono_2d_patch
'
res
=
self
.
roiset
.
run_exports
(
where
,
channel
=-
1
,
prefix
=
'
test
'
,
params
=
p
)
# test that exported patches are padded dimension
for
fn
in
res
[
'
patches_2d
'
]:
pa
=
where
/
fn
self
.
assertTrue
(
pa
.
exists
())
pacc
=
generate_file_accessor
(
pa
)
self
.
assertEqual
(
pacc
.
chroma
,
1
)
print
(
'
res
'
)
class
TestRoiSet
FromZmask
(
unittest
.
TestCase
):
class
TestRoiSet
Serialization
(
unittest
.
TestCase
):
def
setUp
(
self
)
->
None
:
# set up test raw data and segmentation from 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