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
a6789c6d
Commit
a6789c6d
authored
Dec 01, 2015
by
lucasb-eyer
Browse files
Change nlabels from 3 to 5 in readme to avoid confusion with nchannels.
parent
d51b026b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
README.md
README.md
+5
-5
No files found.
README.md
View file @
a6789c6d
...
...
@@ -43,7 +43,7 @@ For images, the easiest way to use this library is using the `DenseCRF2D` class:
import
numpy
as
np
import
densecrf
as
dcrf
d
=
dcrf
.
DenseCRF2D
(
640
,
480
,
3
)
# width, height, nlabels
d
=
dcrf
.
DenseCRF2D
(
640
,
480
,
5
)
# width, height, nlabels
```
Unary potential
...
...
@@ -53,9 +53,9 @@ You can then set a fixed unary potential in the following way:
```
python
U
=
np
.
array
(...)
# Get the unary in some way.
print
(
U
.
shape
)
# -> (640, 480,
3
)
print
(
U
.
shape
)
# -> (640, 480,
5
)
print
(
U
.
dtype
)
# -> dtype('float32')
U
=
U
.
reshape
((
-
1
,
3
))
# Needs to be flat.
U
=
U
.
reshape
((
-
1
,
5
))
# Needs to be flat.
d
.
setUnaryEnergy
(
U
)
# Or alternatively: d.setUnary(ConstUnary(U))
...
...
@@ -151,10 +151,10 @@ potentials `addPairwiseGaussian` and `addPairwiseBilateral` are missing.
Instead, you need to use the generic
`addPairwiseEnergy`
method like this:
```
python
d
=
dcrf
.
DenseCRF
(
100
,
3
)
# npoints, nlabels
d
=
dcrf
.
DenseCRF
(
100
,
5
)
# npoints, nlabels
feats
=
np
.
array
(...)
# Get the pairwise features from somewhere.
print
(
feats
.
shape
)
# -> (
5
, 100) = (feature dimensionality, npoints)
print
(
feats
.
shape
)
# -> (
7
, 100) = (feature dimensionality, npoints)
print
(
feats
.
dtype
)
# -> dtype('float32')
dcrf
.
addPairwiseEnergy
(
feats
)
...
...
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