Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
pydensecrf
Commits
74652c2b
Commit
74652c2b
authored
May 16, 2016
by
lucasb-eyer
Browse files
Utils example computes number of labels.
Fixes #13 continuation.
parent
42402df8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
examples/utils_example.py
examples/utils_example.py
+4
-2
No files found.
examples/utils_example.py
View file @
74652c2b
...
@@ -25,8 +25,10 @@ fn_output = sys.argv[3]
...
@@ -25,8 +25,10 @@ fn_output = sys.argv[3]
### Read images and annotation ###
### Read images and annotation ###
##################################
##################################
img
=
cv2
.
imread
(
fn_im
)
img
=
cv2
.
imread
(
fn_im
)
labels
=
relabel_sequential
(
cv2
.
imread
(
fn_anno
,
0
))[
0
].
flatten
()
labels
,
_
,
_
=
relabel_sequential
(
cv2
.
imread
(
fn_anno
,
0
))
M
=
21
# 21 Classes to match the C++ example
# Compute the number of classes in the label image
M
=
len
(
set
(
labels
.
flat
))
###########################
###########################
### Setup the CRF model ###
### Setup the CRF model ###
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment