Skip to content
Open
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
12 changes: 9 additions & 3 deletions apps/dash-avs-explorer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ cd dash-sample-apps/apps/dash-avs-explorer

Create and activate a conda env:
```
conda create -n dash-avs-explorer python=3.7.6
conda create -n dash-avs-explorer python=3.12
conda activate dash-avs-explorer
```

Or a venv (make sure your `python3` is 3.6+):
Or a venv (make sure your `python3` is 3.12 or newer):
```
python3 -m venv venv
source venv/bin/activate # for Windows, use venv\Scripts\activate.bat
Expand All @@ -38,9 +38,15 @@ Install all the requirements:
pip install -r requirements.txt
```

Or, with [uv](https://docs.astral.sh/uv/), create the environment and install everything in one step:

```
uv sync
```

You can now run the app:
```
python app.py
python app.py # or: uv run app.py
```

and visit http://127.0.0.1:8050/.
Expand Down
57 changes: 38 additions & 19 deletions apps/dash-avs-explorer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
import dash
from dash.dependencies import Input, Output, State
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash import dcc, html


def Header(name, app):
Expand All @@ -28,7 +27,7 @@ def Header(name, app):
STYLES = ["light", "dark", "satellite"]

DATASETS = {
"kitti": "https://raw.githubusercontent.com/plotly/xviz-data-kitti/master/2011_09_26/",
"kitti": "https://raw.githubusercontent.com/uber/xviz-data/master/kitti/",
"nuScenes": "https://raw.githubusercontent.com/uber/xviz-data/master/nutonomy/",
}

Expand All @@ -39,41 +38,58 @@ def Header(name, app):
"nuScenes": {x: f"scene-{x}/" for x in ["0006"]},
}

# Scenes whose data is still hosted; the others are listed but disabled
AVAILABLE_SCENES = {
"kitti": ["2011_09_26_drive_0005_sync/"],
"nuScenes": ["scene-0006/"],
}

controls = [
dbc.FormGroup(
[
html.Div(
className="mb-3",
children=[
dbc.Label("Map Style"),
dbc.Select(
id="select-style",
options=[{"label": s.capitalize(), "value": s} for s in STYLES],
value=STYLES[0],
),
]
],
),
dbc.FormGroup(
[
html.Div(
className="mb-3",
children=[
dbc.Label("Dataset"),
dbc.RadioItems(
id="select-dataset",
options=[{"label": x, "value": x} for x in DATASETS],
value="kitti",
),
]
],
),
html.Div(
className="mb-3",
children=[dbc.Label("Scene"), dbc.RadioItems(id="select-scene", inline=True)],
),
dbc.FormGroup([dbc.Label("Scene"), dbc.RadioItems(id="select-scene", inline=True)]),
dbc.FormGroup(
[
html.Div(
className="mb-3",
children=[
dbc.Label("Mode"),
dbc.Checklist(
id="select-mode",
options=[{"label": "advanced", "value": "advanced"}],
value=[],
switch=True,
),
]
],
),
dbc.FormGroup(
[dbc.Label("About this app"), html.Br(), dbc.Button("More Info", id="btn-info")]
html.Div(
className="mb-3",
children=[
dbc.Label("About this app"),
html.Br(),
dbc.Button("More Info", id="btn-info"),
],
),
]

Expand Down Expand Up @@ -154,10 +170,13 @@ def toggle_collapse(n, is_open):
)
def update_scene_selection(dataset):
scenes = SCENES[dataset]
options = [{"label": k, "value": v} for k, v in scenes.items()]
value = list(scenes.values())[0]
available = AVAILABLE_SCENES[dataset]
options = [
{"label": k, "value": v, "disabled": v not in available}
for k, v in scenes.items()
]

return options, value
return options, available[0]


@app.callback(
Expand Down Expand Up @@ -196,4 +215,4 @@ def update_log(scene, style, mode, dataset):


if __name__ == "__main__":
app.run_server(debug=True)
app.run(debug=True)
13 changes: 13 additions & 0 deletions apps/dash-avs-explorer/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[project]
name = "dash-avs-explorer"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = [
"dash>=4.4.1",
"dash-bootstrap-components>=2.0.4",
"dash-avs-ui",
"gunicorn>=26.2.0",
]

[tool.uv.sources]
dash-avs-ui = { path = "dash_avs_ui-0.0.1.tar.gz" }
36 changes: 31 additions & 5 deletions apps/dash-avs-explorer/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# dash is required to call `build:py`
dash
dash-bootstrap-components
dash_avs_ui-0.0.1.tar.gz
gunicorn
./dash_avs_ui-0.0.1.tar.gz
annotated-types==0.8.0
blinker==1.9.0
certifi==2026.7.22
charset-normalizer==3.5.1
click==8.5.0
comm==0.2.3
dash==4.4.1
dash-bootstrap-components==2.0.4
flask==3.1.3
gunicorn==26.2.0
idna==3.19
importlib-metadata==9.0.1
itsdangerous==2.2.0
janus==2.0.0
jinja2==3.1.6
markupsafe==3.0.3
narwhals==2.25.0
nest-asyncio==1.6.0
packaging==26.3
plotly==7.0.0
pydantic==2.13.5
pydantic-core==2.46.5
requests==2.34.2
retrying==1.4.2
setuptools==84.0.0
typing-extensions==4.16.0
typing-inspection==0.4.4
urllib3==2.7.0
werkzeug==3.1.8
zipp==4.1.0
2 changes: 1 addition & 1 deletion apps/dash-avs-explorer/runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.7.6
python-3.12.11
Loading