def _returnfaces(self, request):
''' returnes the processed images with the detected artifacts highlighted '''
try:
image = yield from self._getlastimage()
image_buf = cv2.imencode('.jpg', image)[1]
image_str = np.array(image_buf).tostring()
except asyncio.QueueEmpty as qe:
msg = 'QueueEmpty exception has been thrown. There is no image ' \
'with some recognized artifacts in the queue right now.'
self._logger.warning(msg)
return Response(
text=msg,
status=500,
content_type='application/json'
)
return Response(
body=image_str,
status=200,
content_type='image/jpeg'
)
评论列表
文章目录