提交 742dc61a 编写于 作者: S superjom

Merge branch 'develop' of github.com:VisualDL/VisualDL into feature/refactor_storage_interface

# VisualDL # VisualDL
### How to use
#### Step 1: build and install Python package
```shell
python setup.py bdist_wheel
cd dist
pip install visualdl-0.0.1-py2-none-any.whl
```
#### Step 2: build frontend
```shell
cd visualdl/frontend
npm install
npm run build
```
### Step 3: run
```
python bin/visual_dl.py --port=8888
```
""" entry point of visual_dl """ entry point of visual_dl
""" """
import json import json
import os
import sys
from optparse import OptionParser from optparse import OptionParser
from flask import Flask from flask import Flask, redirect
from flask import request from flask import send_from_directory
from visualdl.log import logger from visualdl.log import logger
app = Flask(__name__) app = Flask(__name__, static_url_path="")
def option_parser(): def option_parser():
...@@ -44,12 +46,23 @@ def gen_result(status, msg): ...@@ -44,12 +46,23 @@ def gen_result(status, msg):
return result return result
@app.route('/') server_path = os.path.abspath(os.path.dirname(sys.argv[0]))
static_file_path = "../visualdl/frontend/dist/"
@app.route('/static/<path:filename>')
def serve_static(filename):
return send_from_directory(
os.path.join(server_path, static_file_path), filename)
@app.route("/")
def index(): def index():
""" return redirect('/static/index.html', code=302)
:return:
""" @app.route('/hello')
def hello():
result = gen_result(0, "Hello, this is VisualDL!") result = gen_result(0, "Hello, this is VisualDL!")
return json.dumps(result) return json.dumps(result)
......
...@@ -48,4 +48,3 @@ IM 与 Server 的关系是 ...@@ -48,4 +48,3 @@ IM 与 Server 的关系是
### Protobuf API ### Protobuf API
- 决定了底层的数据格式,protobuf 提供了序列化的公共界面 - 决定了底层的数据格式,protobuf 提供了序列化的公共界面
- SDK通过Protobuf API操作底层数据 - SDK通过Protobuf API操作底层数据
from setuptools import setup from setuptools import setup
setup(name="visualdl", setup(
name="visualdl",
version="0.0.1", version="0.0.1",
packages=['visualdl'], packages=['visualdl'],
include_package_data=True, include_package_data=True,
install_requires=[ install_requires=['flask>=0.12.1'],
'flask>=0.12.1'
],
url='http://www.baidu.com/', url='http://www.baidu.com/',
license='Apache 2.0', license='Apache 2.0', )
)
import log import log
__all__ = [ __all__ = ['log']
'log'
]
...@@ -46,11 +46,7 @@ class TabletTester(unittest.TestCase): ...@@ -46,11 +46,7 @@ class TabletTester(unittest.TestCase):
scalar = self.tablet.as_float_scalar() scalar = self.tablet.as_float_scalar()
py_captions = ["train", "test"] py_captions = ["train", "test"]
step_ids = [10, 20, 30] step_ids = [10, 20, 30]
py_records = [ py_records = [[0.1, 0.2], [0.2, 0.3], [0.3, 0.4]]
[0.1, 0.2],
[0.2, 0.3],
[0.3, 0.4]
]
scalar.set_captions(py_captions) scalar.set_captions(py_captions)
for i in range(len(py_records)): for i in range(len(py_records)):
......
...@@ -6,4 +6,3 @@ new App({ ...@@ -6,4 +6,3 @@ new App({
titleName: 'VisualDL' titleName: 'VisualDL'
} }
}).attach(document.getElementById('root')); }).attach(document.getElementById('root'));
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册