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
215a8002
Commit
215a8002
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Changed label in existing project file
parent
a7d1a717
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
extensions/chaeo/examples/transfer_labels_to_ilastik_object_classifier.py
+24
-0
24 additions, 0 deletions
.../examples/transfer_labels_to_ilastik_object_classifier.py
with
24 additions
and
0 deletions
extensions/chaeo/examples/transfer_labels_to_ilastik_object_classifier.py
0 → 100644
+
24
−
0
View file @
215a8002
from
pathlib
import
Path
import
h5py
import
ilastik.applets.objectClassification
import
pandas
as
pd
from
extensions.ilastik.models
import
IlastikObjectClassifierModel
def
transfer_labels_to_ilastik_ilp
(
ilp
,
df_stack_meta
):
with
h5py
.
File
(
ilp
,
'
r+
'
)
as
h5
:
ts
=
h5
[
'
ObjectClassification
'
][
'
LabelInputs
'
][
'
0000
'
]
for
ti
in
ts
.
items
():
idx
=
int
(
ti
[
0
])
ds
=
ti
[
1
]
la_old
=
ds
[
1
]
ds
[
1
]
=
float
(
df_stack_meta
.
loc
[
df_stack_meta
.
zi
==
idx
,
'
annotation_class_id
'
].
iat
[
0
])
print
(
f
'
Changed label
{
ti
}
from
{
la_old
}
to
{
ds
[
1
]
}
'
)
if
__name__
==
'
__main__
'
:
ilp
=
'
c:/Users/rhodes/model-server/ilastik/test_automate_obj_labels.ilp
'
df
=
pd
.
read_csv
(
'
c:/Users/rhodes/projects/proj0011-plankton-seg/exp0009/output/labeled_patches-20231013-0022/training_stack.csv
'
)
transfer_labels_to_ilastik_ilp
(
ilp
,
df
)
\ 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