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
e980866d
Commit
e980866d
authored
Jan 06, 2016
by
Kevin Keraudren
Browse files
cleaner docstring and added reference to original C++ file
parent
789daf57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
dense_inference.py
dense_inference.py
+7
-3
No files found.
dense_inference.py
View file @
e980866d
#!/usr/bin/python
#!/usr/bin/python
"""
Usage: python dense_inference.py image annotations output
Adapted from the original C++ example: densecrf/examples/dense_inference.cpp
http://www.philkr.net/home/densecrf Version 2.2
"""
import
numpy
as
np
import
numpy
as
np
import
cv2
import
cv2
import
densecrf
as
dcrf
import
densecrf
as
dcrf
from
skimage.segmentation
import
relabel_sequential
from
skimage.segmentation
import
relabel_sequential
import
sys
import
sys
# Usage:
# python dense_inference.py image annotations output
img
=
cv2
.
imread
(
sys
.
argv
[
1
],
1
)
img
=
cv2
.
imread
(
sys
.
argv
[
1
],
1
)
labels
=
relabel_sequential
(
cv2
.
imread
(
sys
.
argv
[
2
],
0
))[
0
].
flatten
()
labels
=
relabel_sequential
(
cv2
.
imread
(
sys
.
argv
[
2
],
0
))[
0
].
flatten
()
output
=
sys
.
argv
[
3
]
output
=
sys
.
argv
[
3
]
...
...
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