我试图在this tutorial中安装menpo。之后我安装了menpofit,menpo3d和menpodetect:
conda install -c menpo menpofit
conda install -c menpo menpo3d
conda install -c menpo menpodetect
接下来我从CMD运行这个python脚本( python testPy.py ):
import menpo.io as mio
from menpo.visualize import visualize_images
images = list(mio.import_images('A:/img/*.png'))
visualize_images(images)
获得此输出: 我做错了什么以及如何解决它?
答案 0 :(得分:4)
visualize_images
似乎意在使用ipython-notebook
。以常规python
脚本调用它似乎不是作者想要的。
另请参阅文档的Visualizing Objects
部分中的示例:
%matplotlib inline
import menpo.io as mio
from menpo.visualize import visualize_images
# import_images is a generator, so we must exhaust the generator before
# we can visualize the list. This is because the widget allows you to
# jump arbitrarily around the list, which cannot be done with generators.
images = list(mio.import_images('./path/to/images/*.jpg'))
visualize_images(images)