Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
model_server
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
Christopher Randolph Rhodes
model_server
Commits
77d39bee
Commit
77d39bee
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Removed trivial diffs from chaeo_extension
parent
d09fe9c9
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/accessors.py
+4
-2
4 additions, 2 deletions
model_server/base/accessors.py
model_server/base/batch.py
+0
-22
0 additions, 22 deletions
model_server/base/batch.py
with
4 additions
and
24 deletions
model_server/base/accessors.py
+
4
−
2
View file @
77d39bee
...
...
@@ -34,8 +34,6 @@ class GenericImageDataAccessor(ABC):
def
is_3d
(
self
):
return
True
if
self
.
shape_dict
[
'
Z
'
]
>
1
else
False
# TODO: implement is_probability
def
is_mask
(
self
):
return
is_mask
(
self
.
_data
)
...
...
@@ -117,6 +115,10 @@ class TifSingleSeriesFileAccessor(GenericImageFileAccessor):
axs
.
append
(
'
C
'
)
da
=
np
.
expand_dims
(
da
,
len
(
da
.
shape
))
if
'
Z
'
not
in
axs
:
axs
.
append
(
'
Z
'
)
da
=
np
.
expand_dims
(
da
,
len
(
da
.
shape
))
yxcz
=
np
.
moveaxis
(
da
,
[
axs
.
index
(
k
)
for
k
in
order
],
...
...
This diff is collapsed.
Click to expand it.
model_server/base/batch.py
deleted
100644 → 0
+
0
−
22
View file @
d09fe9c9
def
get_tif_seq
(
where
,
prefix
=
None
,
verbose
=
True
):
files
=
[
ff
for
ff
in
os
.
listdir
(
where
)
if
ff
.
startswith
(
prefix
)]
files
.
sort
()
paths
=
[
where
/
fn
for
fn
in
files
]
ndas
=
[
imread
(
pa
.
__str__
())
for
pa
in
paths
]
assert
all
([
n
.
shape
==
ndas
[
0
].
shape
and
n
.
dtype
==
ndas
[
0
].
dtype
for
n
in
ndas
])
if
verbose
:
print
(
f
'
Successfully read
{
len
(
ndas
)
}
x
{
ndas
[
0
].
shape
}
px images of type
{
ndas
[
0
].
dtype
}
from:
\n
{
where
}
'
)
return
ndas
def
write_tif_zstack
(
data
,
desc
,
dtype
=
'
uint16
'
,
subdir
=
'
output
'
):
where
=
root
/
subdir
filename
=
desc
+
'
.tif
'
if
not
os
.
path
.
exists
(
where
):
os
.
makedirs
(
where
)
abspath
=
where
/
filename
imwrite
(
abspath
,
np
.
array
(
data
).
astype
(
dtype
),
imagej
=
True
)
print
(
f
'
Successfully wrote
{
len
(
data
)
}
x
{
data
[
0
].
shape
}
px images of type
{
dtype
}
to:
\n
{
abspath
}
'
)
\ 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