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
3be7e595
Commit
3be7e595
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Batch workflow now running without errors and creating meaningful output data
parent
29f45db2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
extensions/chaeo/workflows.py
+18
-23
18 additions, 23 deletions
extensions/chaeo/workflows.py
with
18 additions
and
23 deletions
extensions/chaeo/workflows.py
+
18
−
23
View file @
3be7e595
...
...
@@ -265,36 +265,31 @@ def infer_object_map_from_zstack(
# send patches and mask stacks to object classifier
result_acc
,
_
=
object_classifier
.
infer
(
patches_acc
,
patch_masks_acc
)
object_labels_map
=
np
.
copy
(
interm
[
'
label_map
'
])
assert
object_labels_map
.
shape
==
interm
[
'
label_map
'
].
shape
assert
object_labels_map
.
dtype
==
interm
[
'
label_map
'
].
dtype
labels_map
=
interm
[
'
label_map
'
]
output_map
=
np
.
zeros
(
labels_map
.
shape
,
dtype
=
labels_map
.
dtype
)
assert
labels_map
.
shape
==
interm
[
'
label_map
'
].
shape
assert
labels_map
.
dtype
==
interm
[
'
label_map
'
].
dtype
# assign labels to object map:
meta
=
[]
for
ii
in
range
(
0
,
len
(
zmask_meta
)):
mi
=
zmask_meta
[
ii
]
object_label_id
=
mi
[
'
info
'
].
label
result_label_map
=
mask_largest_object
(
result_acc
.
iat
(
ii
))
assert
result_label_map
.
ndim
==
2
unique_values
=
np
.
unique
(
result_label_map
)
if
not
len
(
unique_values
)
==
2
:
mask_largest_object
(
result_label_map
)
raise
Exception
()
assert
unique_values
[
0
]
==
0
ii_mask
=
object_labels_map
==
object_label_id
object_labels_map
[
ii_mask
]
=
unique_values
[
1
]
# object_labels_map[ii_mask] = np.unique(
# mask_largest_object(
# result_acc.iat(ii)
# )
# )[1]
# patch = patches_acc.iat(ii)
object_id
=
zmask_meta
[
ii
][
'
info
'
].
label
result_patch
=
mask_largest_object
(
result_acc
.
iat
(
ii
))
object_class
=
np
.
unique
(
result_patch
)[
1
]
output_map
[
labels_map
==
object_id
]
=
object_class
meta
.
append
({
'
object_id
'
:
ii
,
'
object_class
'
:
object_id
})
write_accessor_data_to_file
(
Path
(
output_folder_path
)
/
'
obj_classes_
'
/
(
fstem
+
'
.tif
'
),
object_labels
_map
Path
(
output_folder_path
)
/
(
'
obj_classes_
'
+
(
fstem
+
'
.tif
'
)
)
,
InMemoryDataAccessor
(
output
_map
)
)
ti
.
click
(
'
export_object_classes
'
)
return
ti
return
{
'
timer_results
'
:
ti
.
events
,
'
dataframe
'
:
pd
.
DataFrame
(
meta
),
'
interm
'
:
{},
}
...
...
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