You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Requiring the `reshape` on the unary is an API wart that I'd like to fix, but
70
70
don't know how to without introducing an explicit dependency on numpy.
71
71
72
+
**Note** that the `nlabels` dimension is the first here before the reshape;
73
+
you may need to move it there before reshaping if that's not already the case,
74
+
like so:
75
+
76
+
```python
77
+
print(U.shape) # -> (480, 640, 5)
78
+
U = U.transpose(2, 0, 1).reshape((5,-1))
79
+
```
80
+
72
81
### Getting a Unary
73
82
74
83
There's two common ways of getting unary potentials:
@@ -251,6 +260,15 @@ This is a pretty [co](https://github.com/lucasb-eyer/pydensecrf/issues/52)mm[on]
251
260
It means exactly what it says: you are passing a `double` but it wants a `float`.
252
261
Solve it by, for example, calling `d.setUnaryEnergy(U.astype(np.float32))` instead of just `d.setUnaryEnergy(U)`, or using `float32` in your code in the first place.
253
262
263
+
My results are all pixelated like [MS Paint's airbrush tool](http://lmgtfy.com/?q=MS+Paint+Airbrush+tool)!
0 commit comments