Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

252 dashboard #291

Merged
merged 18 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added dashboard/app_data/bee.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dashboard/app_data/binary-mnist.npz
Binary file not shown.
Binary file added dashboard/app_data/digit0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dashboard/app_data/leafsnap_model.onnx
Binary file not shown.
Binary file added dashboard/app_data/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dashboard/app_data/mnist_model_tf.onnx
Binary file not shown.
Binary file added dashboard/app_data/movie_review_model.onnx
Binary file not shown.
525 changes: 525 additions & 0 deletions dashboard/callbacks.py

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions dashboard/dashboard.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# Dash&Flask\n",
"import dash\n",
"from dash import html, dcc\n",
"# Custom libraries\n",
"import layouts\n",
"from layouts import images_page, text_page\n",
"import utilities\n",
"import callbacks\n",
"from callbacks import app\n",
"# Others\n",
"import warnings\n",
"warnings.filterwarnings('ignore') # disable warnings relateds to versions of tf"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<module 'utilities' from '/Users/giuliacrocioni/Desktop/eScience/projects_2022/DIANNA/dianna/dashboard/utilities.py'>"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# debug\n",
"from importlib import reload\n",
"reload(layouts)\n",
"reload(utilities)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Dash app running on http://127.0.0.1:8050/\n"
]
}
],
"source": [
"app.layout = html.Div([\n",
" dcc.Location(id='url', refresh=False),\n",
" html.Div(id='page-content')\n",
"])\n",
"\n",
"@app.callback(dash.dependencies.Output('page-content', 'children'),\n",
" [dash.dependencies.Input('url', 'pathname')])\n",
"def display_page(pathname):\n",
" if pathname == '/apps/text':\n",
" return text_page\n",
" else:\n",
" return images_page # home page\n",
"\n",
"app.run_server(mode='external', port=8050)"
]
}
],
"metadata": {
"interpreter": {
"hash": "1169365229a6973d4396a155ae30c4ccccac7e32d4a33e84a8e817391c6ab2d2"
},
"kernelspec": {
"display_name": "Python 3.9.10 ('dianna_new')",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading