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
61130b78
Commit
61130b78
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Corrected slicing mistake that caused error in edge cases
parent
aade8740
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
extensions/chaeo/annotators.py
+1
-1
1 addition, 1 deletion
extensions/chaeo/annotators.py
extensions/chaeo/products.py
+2
-4
2 additions, 4 deletions
extensions/chaeo/products.py
extensions/chaeo/zmask.py
+5
-2
5 additions, 2 deletions
extensions/chaeo/zmask.py
with
8 additions
and
7 deletions
extensions/chaeo/annotators.py
+
1
−
1
View file @
61130b78
...
...
@@ -63,5 +63,5 @@ def draw_contours_on_patch(patch, contours, linewidth=1):
pilimg
=
Image
.
fromarray
(
patch
)
# drawing modifies array in-place
draw
=
ImageDraw
.
Draw
(
pilimg
)
for
co
in
contours
:
draw
.
line
([(
p
[
1
],
p
[
0
])
for
p
in
co
],
width
=
linewidth
)
draw
.
line
([(
p
[
1
],
p
[
0
])
for
p
in
co
],
width
=
linewidth
,
joint
=
'
curve
'
)
return
np
.
array
(
pilimg
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
extensions/chaeo/products.py
+
2
−
4
View file @
61130b78
...
...
@@ -154,10 +154,8 @@ def export_patches_from_zstack(
if
kwargs
.
get
(
'
draw_contour
'
):
mci
=
kwargs
.
get
(
'
contour_channel
'
,
0
)
mask
=
np
.
zeros
(
patch
.
shape
[
0
:
2
],
dtype
=
bool
)
try
:
mask
[
sp_sl
[
0
:
2
]]
=
mi
[
'
mask
'
]
except
Exception
:
a
=
1
mask
[
sp_sl
[
0
:
2
]]
=
mi
[
'
mask
'
]
for
zi
in
range
(
0
,
patch
.
shape
[
3
]):
patch
[:,
:,
mci
,
zi
]
=
draw_contours_on_patch
(
patch
[:,
:,
mci
,
zi
],
...
...
This diff is collapsed.
Click to expand it.
extensions/chaeo/zmask.py
+
5
−
2
View file @
61130b78
...
...
@@ -90,9 +90,9 @@ def build_zmask_from_object_mask(
meta
=
[]
for
ob
in
df
[
df
[
'
keeper
'
]].
itertuples
(
name
=
'
LabeledObject
'
):
y0
=
max
(
ob
.
y0
-
ebxy
,
0
)
y1
=
min
(
ob
.
y1
+
ebxy
,
h
-
1
)
y1
=
min
(
ob
.
y1
+
ebxy
,
h
)
x0
=
max
(
ob
.
x0
-
ebxy
,
0
)
x1
=
min
(
ob
.
x1
+
ebxy
,
w
-
1
)
x1
=
min
(
ob
.
x1
+
ebxy
,
w
)
z0
=
max
(
ob
.
zi
-
ebz
,
0
)
z1
=
min
(
ob
.
zi
+
ebz
,
nz
)
...
...
@@ -111,6 +111,9 @@ def build_zmask_from_object_mask(
contour
=
find_contours
(
obmask
)
mask
=
obmask
[
ob
.
y0
:
ob
.
y1
,
ob
.
x0
:
ob
.
x1
]
assert
rbb
[
'
x1
'
]
<=
(
x1
-
x0
)
assert
rbb
[
'
y1
'
]
<=
(
y1
-
y0
)
meta
.
append
({
'
info
'
:
ob
,
'
slice
'
:
sl
,
...
...
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