【发布时间】:2017-10-30 07:24:57
【问题描述】:
我正在尝试在虚拟机 (VB) 上运行的 Ubuntu 12.04 上从 https://github.com/Microsoft/Cognitive-Face-Python 运行 Face API 示例。当我选择要检测的图像时,它会发送一个请求并接收结果,但之后:
sample/util.py:176: wxPyDeprecationWarning: Call to deprecated item EmptyImage. Use :class:`Image` instead.
wx_image = wx.EmptyImage(pil_image.width, pil_image.height)
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
python: ../../src/xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted (core dumped)`
我已经检测到它停止的地方:
try:
attributes = (
'age,gender,headPose,smile,facialHair,glasses,emotion,hair,'
'makeup,occlusion,accessories,blur,exposure,noise'
)
# the call
res = util.CF.face.detect(path, False, False, attributes)
faces = [model.Face(face, path) for face in res]
# ... WON'T GET HERE ...
self.face_list.SetItems(faces)
util.draw_bitmap_rectangle(self.bitmap, faces)
log_text = 'Response: Success. Detected {} face(s) in {}'.format(
len(res), path)
self.log.log(log_text)
text = '{} face(s) has been detected.'.format(len(res))
self.result.SetLabelText(text)
except util.CF.CognitiveFaceException as exp:
self.log.log('Response: {}. {}'.format(exp.code, exp.msg))
这个sn-p来自sample/view/panel_detection.py
【问题讨论】:
-
我在 ubuntu VM (12.04) 上重现了该错误,我没有太多时间深入挖掘,但从外观上看,应用程序在 wxPython 的 API 上崩溃存在(即当我放置断点并检查我没有看到函数的对象时)所以我怀疑这个库的版本有问题。我下载了 2.9 BTW,这是示例告诉我们使用的版本
标签: python ubuntu-12.04 microsoft-cognitive