def post(self):
try:
url = self.get_argument("url", None)
if (not url): # take a default image
url = "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Serpent_roi_bandes_grises_01.JPG/300px-Serpent_roi_bandes_grises_01.JPG"
call = dualprocessing.AsyncCall("predict", url=url)
response = yield computationBroker.submit_call_async(call)
if (response.Success):
self.write(response.Result)
else:
raise response.Error
except:
def lastExceptionString():
exc_type, ex, exc_tb = sys.exc_info()
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
return "{0} in {1}:{2}".format(ex, fname, exc_tb.tb_lineno)
exmsg = lastExceptionString()
logging.critical(exmsg)
self.write(exmsg)
评论列表
文章目录