提交 e7795726 编写于 作者: Y Yan Chunwei 提交者: GitHub

codeclean/graph graphviz (#92)

上级 fbff7ef9
......@@ -183,15 +183,7 @@ def histogram():
@app.route('/data/plugin/graphs/graph')
def graph():
global graph_image_path
# TODO(ChunweiYan) need to add a config for whether have graph.
image_dir = os.path.join(options.logdir, "graphs")
if not os.path.isdir(image_dir):
os.mkdir(image_dir)
image_path = vdl_graph.draw_graph(options.model_pb, image_dir)
graph_image_path = image_path
print 'image_path', image_path
data = {'url': '/graphs/image'}
result = gen_result(0, "", data)
return Response(json.dumps(result), mimetype='application/json')
......@@ -203,4 +195,10 @@ if __name__ == '__main__':
logger.error("should pass in logdir option")
sys.exit(-1)
# draw graph
image_dir = os.path.join(options.logdir, "graphs")
if not os.path.isdir(image_dir):
os.mkdir(image_dir)
graph_image_path = vdl_graph.draw_graph(options.model_pb, image_dir)
app.run(debug=False, host=options.host, port=options.port)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册