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
7c46feec
Commit
7c46feec
authored
Aug 20, 2016
by
Lucas Beyer
Committed by
GitHub
Aug 20, 2016
Browse files
Merge pull request #20 from reynoldscem/patch-1
Fix off-by-one error in `compute_unary` utility function.
parents
31d4a725
1697e65f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
pydensecrf/utils.py
pydensecrf/utils.py
+1
-1
No files found.
pydensecrf/utils.py
View file @
7c46feec
...
@@ -28,7 +28,7 @@ def compute_unary(labels, M, GT_PROB=0.5):
...
@@ -28,7 +28,7 @@ def compute_unary(labels, M, GT_PROB=0.5):
U
=
np
.
zeros
((
M
,
len
(
labels
)),
dtype
=
'float32'
)
U
=
np
.
zeros
((
M
,
len
(
labels
)),
dtype
=
'float32'
)
U
[:,
labels
>
0
]
=
n_energy
U
[:,
labels
>
0
]
=
n_energy
U
[
labels
,
np
.
arange
(
U
.
shape
[
1
])]
=
p_energy
U
[
labels
-
1
,
np
.
arange
(
U
.
shape
[
1
])]
=
p_energy
U
[:,
labels
==
0
]
=
u_energy
U
[:,
labels
==
0
]
=
u_energy
return
U
return
U
...
...
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