Langelaw commited on
Commit
0d31e31
1 Parent(s): 26fc169

Upload folder using huggingface_hub

Browse files
Files changed (44) hide show
  1. Dockerfile +16 -0
  2. README.md +13 -9
  3. __init__.py +0 -0
  4. __pycache__/__init__.cpython-39.pyc +0 -0
  5. __pycache__/app.cpython-39.pyc +0 -0
  6. app.py +1 -6
  7. css.css +157 -0
  8. requirements.txt +1 -1
  9. space.py +138 -0
  10. src/.gitignore +9 -0
  11. src/README.md +249 -0
  12. src/backend/gradio_model4dgs/__init__.py +4 -0
  13. src/backend/gradio_model4dgs/model4dgs.py +99 -0
  14. src/backend/gradio_model4dgs/model4dgs.pyi +269 -0
  15. src/backend/gradio_model4dgs/templates/component/index.js +0 -0
  16. src/backend/gradio_model4dgs/templates/component/style.css +1 -0
  17. src/backend/gradio_model4dgs/templates/example/index.js +88 -0
  18. src/backend/gradio_model4dgs/templates/example/style.css +1 -0
  19. src/demo/__init__.py +0 -0
  20. src/demo/app.py +17 -0
  21. src/demo/assets/tiger_4d_model_0.ply +0 -0
  22. src/demo/assets/tiger_4d_model_1.ply +0 -0
  23. src/demo/assets/tiger_4d_model_10.ply +0 -0
  24. src/demo/assets/tiger_4d_model_11.ply +0 -0
  25. src/demo/assets/tiger_4d_model_12.ply +0 -0
  26. src/demo/assets/tiger_4d_model_13.ply +0 -0
  27. src/demo/assets/tiger_4d_model_2.ply +0 -0
  28. src/demo/assets/tiger_4d_model_3.ply +0 -0
  29. src/demo/assets/tiger_4d_model_4.ply +0 -0
  30. src/demo/assets/tiger_4d_model_5.ply +0 -0
  31. src/demo/assets/tiger_4d_model_6.ply +0 -0
  32. src/demo/assets/tiger_4d_model_7.ply +0 -0
  33. src/demo/assets/tiger_4d_model_8.ply +0 -0
  34. src/demo/assets/tiger_4d_model_9.ply +0 -0
  35. src/demo/css.css +157 -0
  36. src/demo/space.py +138 -0
  37. src/demo/tiger_rgba.png +0 -0
  38. src/frontend/Example.svelte +19 -0
  39. src/frontend/Index.svelte +62 -0
  40. src/frontend/package-lock.json +1051 -0
  41. src/frontend/package.json +23 -0
  42. src/frontend/shared/Model4DGS.svelte +88 -0
  43. src/pyproject.toml +42 -0
  44. tiger_rgba.png +0 -0
Dockerfile ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ FROM python:3.9
3
+
4
+ WORKDIR /code
5
+
6
+ COPY --link --chown=1000 . .
7
+
8
+ RUN mkdir -p /tmp/cache/
9
+ RUN chmod a+rwx -R /tmp/cache/
10
+ ENV TRANSFORMERS_CACHE=/tmp/cache/
11
+
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ ENV PYTHONUNBUFFERED=1 GRADIO_ALLOW_FLAGGING=never GRADIO_NUM_PORTS=1 GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860 SYSTEM=spaces
15
+
16
+ CMD ["python", "space.py"]
README.md CHANGED
@@ -1,13 +1,17 @@
 
1
  ---
2
- title: Gradio Model4dgs
3
- emoji:
4
- colorFrom: blue
5
- colorTo: indigo
6
- sdk: gradio
7
- sdk_version: 4.15.0
8
- app_file: app.py
9
  pinned: false
10
- license: mit
11
  ---
12
 
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
1
+
2
  ---
3
+ tags: [gradio-custom-component,gradio-template-Fallback]
4
+ title: gradio_model4dgs V0.0.3
5
+ colorFrom: pink
6
+ colorTo: gray
7
+ sdk: docker
 
 
8
  pinned: false
9
+ license: apache-2.0
10
  ---
11
 
12
+
13
+ # Name: gradio_model4dgs
14
+
15
+ Description: Python library for easily interacting with trained machine learning models
16
+
17
+ Install with: pip install gradio_model4dgs
__init__.py ADDED
File without changes
__pycache__/__init__.cpython-39.pyc ADDED
Binary file (148 Bytes). View file
 
__pycache__/app.cpython-39.pyc ADDED
Binary file (745 Bytes). View file
 
app.py CHANGED
@@ -2,8 +2,6 @@ import gradio as gr
2
  from gradio_model4dgs import Model4DGS
3
  import os
4
 
5
- os.system('pip install gradio_model4dgs')
6
-
7
  image_dir = os.path.join(os.path.dirname(__file__), "assets")
8
 
9
  if os.path.exists(image_dir) and os.path.isdir(image_dir) and os.listdir(image_dir):
@@ -11,12 +9,9 @@ if os.path.exists(image_dir) and os.path.isdir(image_dir) and os.listdir(image_d
11
  else:
12
  examples = [os.path.join(os.path.dirname(__file__), example) for example in Model4DGS().example_inputs()]
13
 
14
- print("examples:")
15
- print(examples)
16
-
17
  with gr.Blocks() as demo:
18
  with gr.Row():
19
  Model4DGS(value=examples, label="4D Model")
20
 
21
  if __name__ == "__main__":
22
- demo.launch()
 
2
  from gradio_model4dgs import Model4DGS
3
  import os
4
 
 
 
5
  image_dir = os.path.join(os.path.dirname(__file__), "assets")
6
 
7
  if os.path.exists(image_dir) and os.path.isdir(image_dir) and os.listdir(image_dir):
 
9
  else:
10
  examples = [os.path.join(os.path.dirname(__file__), example) for example in Model4DGS().example_inputs()]
11
 
 
 
 
12
  with gr.Blocks() as demo:
13
  with gr.Row():
14
  Model4DGS(value=examples, label="4D Model")
15
 
16
  if __name__ == "__main__":
17
+ demo.launch(share=True)
css.css ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ html {
2
+ font-family: Inter;
3
+ font-size: 16px;
4
+ font-weight: 400;
5
+ line-height: 1.5;
6
+ -webkit-text-size-adjust: 100%;
7
+ background: #fff;
8
+ color: #323232;
9
+ -webkit-font-smoothing: antialiased;
10
+ -moz-osx-font-smoothing: grayscale;
11
+ text-rendering: optimizeLegibility;
12
+ }
13
+
14
+ :root {
15
+ --space: 1;
16
+ --vspace: calc(var(--space) * 1rem);
17
+ --vspace-0: calc(3 * var(--space) * 1rem);
18
+ --vspace-1: calc(2 * var(--space) * 1rem);
19
+ --vspace-2: calc(1.5 * var(--space) * 1rem);
20
+ --vspace-3: calc(0.5 * var(--space) * 1rem);
21
+ }
22
+
23
+ .app {
24
+ max-width: 748px !important;
25
+ }
26
+
27
+ .prose p {
28
+ margin: var(--vspace) 0;
29
+ line-height: var(--vspace * 2);
30
+ font-size: 1rem;
31
+ }
32
+
33
+ code {
34
+ font-family: "Inconsolata", sans-serif;
35
+ font-size: 16px;
36
+ }
37
+
38
+ h1,
39
+ h1 code {
40
+ font-weight: 400;
41
+ line-height: calc(2.5 / var(--space) * var(--vspace));
42
+ }
43
+
44
+ h1 code {
45
+ background: none;
46
+ border: none;
47
+ letter-spacing: 0.05em;
48
+ padding-bottom: 5px;
49
+ position: relative;
50
+ padding: 0;
51
+ }
52
+
53
+ h2 {
54
+ margin: var(--vspace-1) 0 var(--vspace-2) 0;
55
+ line-height: 1em;
56
+ }
57
+
58
+ h3,
59
+ h3 code {
60
+ margin: var(--vspace-1) 0 var(--vspace-2) 0;
61
+ line-height: 1em;
62
+ }
63
+
64
+ h4,
65
+ h5,
66
+ h6 {
67
+ margin: var(--vspace-3) 0 var(--vspace-3) 0;
68
+ line-height: var(--vspace);
69
+ }
70
+
71
+ .bigtitle,
72
+ h1,
73
+ h1 code {
74
+ font-size: calc(8px * 4.5);
75
+ word-break: break-word;
76
+ }
77
+
78
+ .title,
79
+ h2,
80
+ h2 code {
81
+ font-size: calc(8px * 3.375);
82
+ font-weight: lighter;
83
+ word-break: break-word;
84
+ border: none;
85
+ background: none;
86
+ }
87
+
88
+ .subheading1,
89
+ h3,
90
+ h3 code {
91
+ font-size: calc(8px * 1.8);
92
+ font-weight: 600;
93
+ border: none;
94
+ background: none;
95
+ letter-spacing: 0.1em;
96
+ text-transform: uppercase;
97
+ }
98
+
99
+ h2 code {
100
+ padding: 0;
101
+ position: relative;
102
+ letter-spacing: 0.05em;
103
+ }
104
+
105
+ blockquote {
106
+ font-size: calc(8px * 1.1667);
107
+ font-style: italic;
108
+ line-height: calc(1.1667 * var(--vspace));
109
+ margin: var(--vspace-2) var(--vspace-2);
110
+ }
111
+
112
+ .subheading2,
113
+ h4 {
114
+ font-size: calc(8px * 1.4292);
115
+ text-transform: uppercase;
116
+ font-weight: 600;
117
+ }
118
+
119
+ .subheading3,
120
+ h5 {
121
+ font-size: calc(8px * 1.2917);
122
+ line-height: calc(1.2917 * var(--vspace));
123
+
124
+ font-weight: lighter;
125
+ text-transform: uppercase;
126
+ letter-spacing: 0.15em;
127
+ }
128
+
129
+ h6 {
130
+ font-size: calc(8px * 1.1667);
131
+ font-size: 1.1667em;
132
+ font-weight: normal;
133
+ font-style: italic;
134
+ font-family: "le-monde-livre-classic-byol", serif !important;
135
+ letter-spacing: 0px !important;
136
+ }
137
+
138
+ #start .md > *:first-child {
139
+ margin-top: 0;
140
+ }
141
+
142
+ h2 + h3 {
143
+ margin-top: 0;
144
+ }
145
+
146
+ .md hr {
147
+ border: none;
148
+ border-top: 1px solid var(--block-border-color);
149
+ margin: var(--vspace-2) 0 var(--vspace-2) 0;
150
+ }
151
+ .prose ul {
152
+ margin: var(--vspace-2) 0 var(--vspace-1) 0;
153
+ }
154
+
155
+ .gap {
156
+ gap: 0;
157
+ }
requirements.txt CHANGED
@@ -1 +1 @@
1
- gradio_model4dgs>=0.0.1
 
1
+ gradio_model4dgs==0.0.2
space.py ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import gradio as gr
3
+ from app import demo as app
4
+ import os
5
+
6
+ _docs = {'Model4DGS': {'description': 'Component allows users to upload or view 4D Gaussian Splatting files (.splat).', 'members': {'__init__': {'value': {'type': 'str | Callable | None', 'default': 'None', 'description': 'path to (.splat) file to show in model4DGS viewer. If callable, the function will be called whenever the app loads to set the initial value of the component.'}, 'height': {'type': 'int | None', 'default': 'None', 'description': 'height of the model4DGS component, in pixels.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': None}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': None}, 'every': {'type': 'float | None', 'default': 'None', 'description': None}, 'container': {'type': 'bool', 'default': 'True', 'description': None}, 'scale': {'type': 'int | None', 'default': 'None', 'description': None}, 'min_width': {'type': 'int', 'default': '160', 'description': None}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': None}, 'visible': {'type': 'bool', 'default': 'True', 'description': None}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': None}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': None}, 'render': {'type': 'bool', 'default': 'True', 'description': None}}, 'postprocess': {'value': {'type': 'List[str] | str | None', 'description': "The output data received by the component from the user's function in the backend."}}, 'preprocess': {'return': {'type': 'List[str] | None', 'description': "The preprocessed input data sent to the user's function in the backend."}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the Model4DGS changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'upload': {'type': None, 'default': None, 'description': 'This listener is triggered when the user uploads a file into the Model4DGS.'}, 'edit': {'type': None, 'default': None, 'description': 'This listener is triggered when the user edits the Model4DGS (e.g. image) using the built-in editor.'}, 'clear': {'type': None, 'default': None, 'description': 'This listener is triggered when the user clears the Model4DGS using the X button for the component.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'Model4DGS': []}}}
7
+
8
+ abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
+
10
+ with gr.Blocks(
11
+ css=abs_path,
12
+ theme=gr.themes.Default(
13
+ font_mono=[
14
+ gr.themes.GoogleFont("Inconsolata"),
15
+ "monospace",
16
+ ],
17
+ ),
18
+ ) as demo:
19
+ gr.Markdown(
20
+ """
21
+ # `gradio_model4dgs`
22
+
23
+ <div style="display: flex; gap: 7px;">
24
+ <a href="https://pypi.org/project/gradio_model4dgs/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_model4dgs"></a>
25
+ </div>
26
+
27
+ Python library for easily interacting with trained machine learning models
28
+ """, elem_classes=["md-custom"], header_links=True)
29
+ app.render()
30
+ gr.Markdown(
31
+ """
32
+ ## Installation
33
+
34
+ ```bash
35
+ pip install gradio_model4dgs
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ```python
41
+ import gradio as gr
42
+ from gradio_model4dgs import Model4DGS
43
+ import os
44
+
45
+ image_dir = os.path.join(os.path.dirname(__file__), "assets")
46
+
47
+ if os.path.exists(image_dir) and os.path.isdir(image_dir) and os.listdir(image_dir):
48
+ examples = [os.path.join(image_dir, file) for file in os.listdir(image_dir)]
49
+ else:
50
+ examples = [os.path.join(os.path.dirname(__file__), example) for example in Model4DGS().example_inputs()]
51
+
52
+ with gr.Blocks() as demo:
53
+ with gr.Row():
54
+ Model4DGS(value=examples, label="4D Model")
55
+
56
+ if __name__ == "__main__":
57
+ demo.launch(share=True)
58
+ ```
59
+ """, elem_classes=["md-custom"], header_links=True)
60
+
61
+
62
+ gr.Markdown("""
63
+ ## `Model4DGS`
64
+
65
+ ### Initialization
66
+ """, elem_classes=["md-custom"], header_links=True)
67
+
68
+ gr.ParamViewer(value=_docs["Model4DGS"]["members"]["__init__"], linkify=[])
69
+
70
+
71
+ gr.Markdown("### Events")
72
+ gr.ParamViewer(value=_docs["Model4DGS"]["events"], linkify=['Event'])
73
+
74
+
75
+
76
+
77
+ gr.Markdown("""
78
+
79
+ ### User function
80
+
81
+ The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
82
+
83
+ - When used as an Input, the component only impacts the input signature of the user function.
84
+ - When used as an output, the component only impacts the return signature of the user function.
85
+
86
+ The code snippet below is accurate in cases where the component is used as both an input and an output.
87
+
88
+ - **As input:** Is passed, the preprocessed input data sent to the user's function in the backend.
89
+ - **As output:** Should return, the output data received by the component from the user's function in the backend.
90
+
91
+ ```python
92
+ def predict(
93
+ value: List[str] | None
94
+ ) -> List[str] | str | None:
95
+ return value
96
+ ```
97
+ """, elem_classes=["md-custom", "Model4DGS-user-fn"], header_links=True)
98
+
99
+
100
+
101
+
102
+ demo.load(None, js=r"""function() {
103
+ const refs = {};
104
+ const user_fn_refs = {
105
+ Model4DGS: [], };
106
+ requestAnimationFrame(() => {
107
+
108
+ Object.entries(user_fn_refs).forEach(([key, refs]) => {
109
+ if (refs.length > 0) {
110
+ const el = document.querySelector(`.${key}-user-fn`);
111
+ if (!el) return;
112
+ refs.forEach(ref => {
113
+ el.innerHTML = el.innerHTML.replace(
114
+ new RegExp("\\b"+ref+"\\b", "g"),
115
+ `<a href="#h-${ref.toLowerCase()}">${ref}</a>`
116
+ );
117
+ })
118
+ }
119
+ })
120
+
121
+ Object.entries(refs).forEach(([key, refs]) => {
122
+ if (refs.length > 0) {
123
+ const el = document.querySelector(`.${key}`);
124
+ if (!el) return;
125
+ refs.forEach(ref => {
126
+ el.innerHTML = el.innerHTML.replace(
127
+ new RegExp("\\b"+ref+"\\b", "g"),
128
+ `<a href="#h-${ref.toLowerCase()}">${ref}</a>`
129
+ );
130
+ })
131
+ }
132
+ })
133
+ })
134
+ }
135
+
136
+ """)
137
+
138
+ demo.launch()
src/.gitignore ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ .eggs/
2
+ dist/
3
+ *.pyc
4
+ __pycache__/
5
+ *.py[cod]
6
+ *$py.class
7
+ __tmp/*
8
+ *.pyi
9
+ node_modules
src/README.md ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # `gradio_model4dgs`
3
+ <a href="https://pypi.org/project/gradio_model4dgs/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_model4dgs"></a>
4
+
5
+ Python library for easily interacting with trained machine learning models
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ pip install gradio_model4dgs
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```python
16
+ import gradio as gr
17
+ from gradio_model4dgs import Model4DGS
18
+ import os
19
+
20
+ image_dir = os.path.join(os.path.dirname(__file__), "assets")
21
+
22
+ if os.path.exists(image_dir) and os.path.isdir(image_dir) and os.listdir(image_dir):
23
+ examples = [os.path.join(image_dir, file) for file in os.listdir(image_dir)]
24
+ else:
25
+ examples = [os.path.join(os.path.dirname(__file__), example) for example in Model4DGS().example_inputs()]
26
+
27
+ with gr.Blocks() as demo:
28
+ with gr.Row():
29
+ Model4DGS(value=examples, label="4D Model")
30
+
31
+ if __name__ == "__main__":
32
+ demo.launch(share=True)
33
+ ```
34
+
35
+ ## `Model4DGS`
36
+
37
+ ### Initialization
38
+
39
+ <table>
40
+ <thead>
41
+ <tr>
42
+ <th align="left">name</th>
43
+ <th align="left" style="width: 25%;">type</th>
44
+ <th align="left">default</th>
45
+ <th align="left">description</th>
46
+ </tr>
47
+ </thead>
48
+ <tbody>
49
+ <tr>
50
+ <td align="left"><code>value</code></td>
51
+ <td align="left" style="width: 25%;">
52
+
53
+ ```python
54
+ str | Callable | None
55
+ ```
56
+
57
+ </td>
58
+ <td align="left"><code>None</code></td>
59
+ <td align="left">path to (.splat) file to show in model4DGS viewer. If callable, the function will be called whenever the app loads to set the initial value of the component.</td>
60
+ </tr>
61
+
62
+ <tr>
63
+ <td align="left"><code>height</code></td>
64
+ <td align="left" style="width: 25%;">
65
+
66
+ ```python
67
+ int | None
68
+ ```
69
+
70
+ </td>
71
+ <td align="left"><code>None</code></td>
72
+ <td align="left">height of the model4DGS component, in pixels.</td>
73
+ </tr>
74
+
75
+ <tr>
76
+ <td align="left"><code>label</code></td>
77
+ <td align="left" style="width: 25%;">
78
+
79
+ ```python
80
+ str | None
81
+ ```
82
+
83
+ </td>
84
+ <td align="left"><code>None</code></td>
85
+ <td align="left">None</td>
86
+ </tr>
87
+
88
+ <tr>
89
+ <td align="left"><code>show_label</code></td>
90
+ <td align="left" style="width: 25%;">
91
+
92
+ ```python
93
+ bool | None
94
+ ```
95
+
96
+ </td>
97
+ <td align="left"><code>None</code></td>
98
+ <td align="left">None</td>
99
+ </tr>
100
+
101
+ <tr>
102
+ <td align="left"><code>every</code></td>
103
+ <td align="left" style="width: 25%;">
104
+
105
+ ```python
106
+ float | None
107
+ ```
108
+
109
+ </td>
110
+ <td align="left"><code>None</code></td>
111
+ <td align="left">None</td>
112
+ </tr>
113
+
114
+ <tr>
115
+ <td align="left"><code>container</code></td>
116
+ <td align="left" style="width: 25%;">
117
+
118
+ ```python
119
+ bool
120
+ ```
121
+
122
+ </td>
123
+ <td align="left"><code>True</code></td>
124
+ <td align="left">None</td>
125
+ </tr>
126
+
127
+ <tr>
128
+ <td align="left"><code>scale</code></td>
129
+ <td align="left" style="width: 25%;">
130
+
131
+ ```python
132
+ int | None
133
+ ```
134
+
135
+ </td>
136
+ <td align="left"><code>None</code></td>
137
+ <td align="left">None</td>
138
+ </tr>
139
+
140
+ <tr>
141
+ <td align="left"><code>min_width</code></td>
142
+ <td align="left" style="width: 25%;">
143
+
144
+ ```python
145
+ int
146
+ ```
147
+
148
+ </td>
149
+ <td align="left"><code>160</code></td>
150
+ <td align="left">None</td>
151
+ </tr>
152
+
153
+ <tr>
154
+ <td align="left"><code>interactive</code></td>
155
+ <td align="left" style="width: 25%;">
156
+
157
+ ```python
158
+ bool | None
159
+ ```
160
+
161
+ </td>
162
+ <td align="left"><code>None</code></td>
163
+ <td align="left">None</td>
164
+ </tr>
165
+
166
+ <tr>
167
+ <td align="left"><code>visible</code></td>
168
+ <td align="left" style="width: 25%;">
169
+
170
+ ```python
171
+ bool
172
+ ```
173
+
174
+ </td>
175
+ <td align="left"><code>True</code></td>
176
+ <td align="left">None</td>
177
+ </tr>
178
+
179
+ <tr>
180
+ <td align="left"><code>elem_id</code></td>
181
+ <td align="left" style="width: 25%;">
182
+
183
+ ```python
184
+ str | None
185
+ ```
186
+
187
+ </td>
188
+ <td align="left"><code>None</code></td>
189
+ <td align="left">None</td>
190
+ </tr>
191
+
192
+ <tr>
193
+ <td align="left"><code>elem_classes</code></td>
194
+ <td align="left" style="width: 25%;">
195
+
196
+ ```python
197
+ list[str] | str | None
198
+ ```
199
+
200
+ </td>
201
+ <td align="left"><code>None</code></td>
202
+ <td align="left">None</td>
203
+ </tr>
204
+
205
+ <tr>
206
+ <td align="left"><code>render</code></td>
207
+ <td align="left" style="width: 25%;">
208
+
209
+ ```python
210
+ bool
211
+ ```
212
+
213
+ </td>
214
+ <td align="left"><code>True</code></td>
215
+ <td align="left">None</td>
216
+ </tr>
217
+ </tbody></table>
218
+
219
+
220
+ ### Events
221
+
222
+ | name | description |
223
+ |:-----|:------------|
224
+ | `change` | Triggered when the value of the Model4DGS changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input. |
225
+ | `upload` | This listener is triggered when the user uploads a file into the Model4DGS. |
226
+ | `edit` | This listener is triggered when the user edits the Model4DGS (e.g. image) using the built-in editor. |
227
+ | `clear` | This listener is triggered when the user clears the Model4DGS using the X button for the component. |
228
+
229
+
230
+
231
+ ### User function
232
+
233
+ The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
234
+
235
+ - When used as an Input, the component only impacts the input signature of the user function.
236
+ - When used as an output, the component only impacts the return signature of the user function.
237
+
238
+ The code snippet below is accurate in cases where the component is used as both an input and an output.
239
+
240
+ - **As output:** Is passed, the preprocessed input data sent to the user's function in the backend.
241
+ - **As input:** Should return, the output data received by the component from the user's function in the backend.
242
+
243
+ ```python
244
+ def predict(
245
+ value: List[str] | None
246
+ ) -> List[str] | str | None:
247
+ return value
248
+ ```
249
+
src/backend/gradio_model4dgs/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+
2
+ from .model4dgs import Model4DGS
3
+
4
+ __all__ = ['Model4DGS']
src/backend/gradio_model4dgs/model4dgs.py ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """gr.Model4DGS() component."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from pathlib import Path
6
+ from typing import Callable, List
7
+
8
+ from gradio_client.documentation import document, set_documentation_group
9
+
10
+ from gradio.components.base import Component
11
+ from gradio.data_classes import FileData, GradioModel
12
+ from gradio.events import Events
13
+
14
+ set_documentation_group("component")
15
+
16
+ class Model4DGSData(GradioModel):
17
+ files: List[FileData]
18
+
19
+ @document()
20
+ class Model4DGS(Component):
21
+ """
22
+ Component allows users to upload or view 4D Gaussian Splatting files (.splat).
23
+ Preprocessing: This component passes the uploaded file as a {str}filepath.
24
+ Postprocessing: expects function to return a {str} or {pathlib.Path} filepath of type (.splat)
25
+ """
26
+
27
+ EVENTS = [Events.change, Events.upload, Events.edit, Events.clear]
28
+
29
+ data_model = Model4DGSData
30
+
31
+ def __init__(
32
+ self,
33
+ value: str | Callable | None = None,
34
+ *,
35
+ height: int | None = None,
36
+ label: str | None = None,
37
+ show_label: bool | None = None,
38
+ every: float | None = None,
39
+ container: bool = True,
40
+ scale: int | None = None,
41
+ min_width: int = 160,
42
+ interactive: bool | None = None,
43
+ visible: bool = True,
44
+ elem_id: str | None = None,
45
+ elem_classes: list[str] | str | None = None,
46
+ render: bool = True,
47
+ ):
48
+ """
49
+ Parameters:
50
+ value: path to (.splat) file to show in model4DGS viewer. If callable, the function will be called whenever the app loads to set the initial value of the component.
51
+ height: height of the model4DGS component, in pixels.
52
+ """
53
+ self.height = height
54
+ super().__init__(
55
+ label=label,
56
+ every=every,
57
+ show_label=show_label,
58
+ container=container,
59
+ scale=scale,
60
+ min_width=min_width,
61
+ interactive=interactive,
62
+ visible=visible,
63
+ elem_id=elem_id,
64
+ elem_classes=elem_classes,
65
+ render=render,
66
+ value=value,
67
+ )
68
+
69
+ def preprocess(self, payload: Model4DGSData | None) -> List[str] | None:
70
+ return [file.path for file in payload.files]
71
+
72
+ def postprocess(self, value: List[str] | str | None) -> Model4DGSData | None:
73
+ if value is None:
74
+ return value
75
+ if isinstance(value, list):
76
+ return Model4DGSData(files=[FileData(path=file) for file in value])
77
+ return Model4DGSData(files=[])
78
+
79
+ #example display name
80
+ def as_example(self, input_data: List[str] | str | None) -> str:
81
+ return Path(input_data).name if input_data else ""
82
+
83
+ def example_inputs(self):
84
+ return [
85
+ "assets/tiger_4d_model_0.ply",
86
+ "assets/tiger_4d_model_1.ply",
87
+ "assets/tiger_4d_model_2.ply",
88
+ "assets/tiger_4d_model_3.ply",
89
+ "assets/tiger_4d_model_4.ply",
90
+ "assets/tiger_4d_model_5.ply",
91
+ "assets/tiger_4d_model_6.ply",
92
+ "assets/tiger_4d_model_7.ply",
93
+ "assets/tiger_4d_model_8.ply",
94
+ "assets/tiger_4d_model_9.ply",
95
+ "assets/tiger_4d_model_10.ply",
96
+ "assets/tiger_4d_model_11.ply",
97
+ "assets/tiger_4d_model_12.ply",
98
+ "assets/tiger_4d_model_13.ply"
99
+ ];
src/backend/gradio_model4dgs/model4dgs.pyi ADDED
@@ -0,0 +1,269 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """gr.Model4DGS() component."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from pathlib import Path
6
+ from typing import Callable, List
7
+
8
+ from gradio_client.documentation import document, set_documentation_group
9
+
10
+ from gradio.components.base import Component
11
+ from gradio.data_classes import FileData, GradioModel
12
+ from gradio.events import Events
13
+
14
+ set_documentation_group("component")
15
+
16
+ class Model4DGSData(GradioModel):
17
+ files: List[FileData]
18
+ from gradio.events import Dependency
19
+
20
+ @document()
21
+ class Model4DGS(Component):
22
+ """
23
+ Component allows users to upload or view 4D Gaussian Splatting files (.splat).
24
+ Preprocessing: This component passes the uploaded file as a {str}filepath.
25
+ Postprocessing: expects function to return a {str} or {pathlib.Path} filepath of type (.splat)
26
+ """
27
+
28
+ EVENTS = [Events.change, Events.upload, Events.edit, Events.clear]
29
+
30
+ data_model = Model4DGSData
31
+
32
+ def __init__(
33
+ self,
34
+ value: str | Callable | None = None,
35
+ *,
36
+ height: int | None = None,
37
+ label: str | None = None,
38
+ show_label: bool | None = None,
39
+ every: float | None = None,
40
+ container: bool = True,
41
+ scale: int | None = None,
42
+ min_width: int = 160,
43
+ interactive: bool | None = None,
44
+ visible: bool = True,
45
+ elem_id: str | None = None,
46
+ elem_classes: list[str] | str | None = None,
47
+ render: bool = True,
48
+ ):
49
+ """
50
+ Parameters:
51
+ value: path to (.splat) file to show in model4DGS viewer. If callable, the function will be called whenever the app loads to set the initial value of the component.
52
+ height: height of the model4DGS component, in pixels.
53
+ """
54
+ self.height = height
55
+ super().__init__(
56
+ label=label,
57
+ every=every,
58
+ show_label=show_label,
59
+ container=container,
60
+ scale=scale,
61
+ min_width=min_width,
62
+ interactive=interactive,
63
+ visible=visible,
64
+ elem_id=elem_id,
65
+ elem_classes=elem_classes,
66
+ render=render,
67
+ value=value,
68
+ )
69
+
70
+ def preprocess(self, payload: Model4DGSData | None) -> List[str] | None:
71
+ return [file.path for file in payload.files]
72
+
73
+ def postprocess(self, value: List[str] | str | None) -> Model4DGSData | None:
74
+ if value is None:
75
+ return value
76
+ if isinstance(value, list):
77
+ return Model4DGSData(files=[FileData(path=file) for file in value])
78
+ return Model4DGSData(files=[])
79
+
80
+ #example display name
81
+ def as_example(self, input_data: List[str] | str | None) -> str:
82
+ return Path(input_data).name if input_data else ""
83
+
84
+ def example_inputs(self):
85
+ return [
86
+ "assets/tiger_4d_model_0.ply",
87
+ "assets/tiger_4d_model_1.ply",
88
+ "assets/tiger_4d_model_2.ply",
89
+ "assets/tiger_4d_model_3.ply",
90
+ "assets/tiger_4d_model_4.ply",
91
+ "assets/tiger_4d_model_5.ply",
92
+ "assets/tiger_4d_model_6.ply",
93
+ "assets/tiger_4d_model_7.ply",
94
+ "assets/tiger_4d_model_8.ply",
95
+ "assets/tiger_4d_model_9.ply",
96
+ "assets/tiger_4d_model_10.ply",
97
+ "assets/tiger_4d_model_11.ply",
98
+ "assets/tiger_4d_model_12.ply",
99
+ "assets/tiger_4d_model_13.ply"
100
+ ];
101
+
102
+
103
+ def change(self,
104
+ fn: Callable | None,
105
+ inputs: Component | Sequence[Component] | set[Component] | None = None,
106
+ outputs: Component | Sequence[Component] | None = None,
107
+ api_name: str | None | Literal[False] = None,
108
+ scroll_to_output: bool = False,
109
+ show_progress: Literal["full", "minimal", "hidden"] = "full",
110
+ queue: bool | None = None,
111
+ batch: bool = False,
112
+ max_batch_size: int = 4,
113
+ preprocess: bool = True,
114
+ postprocess: bool = True,
115
+ cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
116
+ every: float | None = None,
117
+ trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
118
+ js: str | None = None,
119
+ concurrency_limit: int | None | Literal["default"] = "default",
120
+ concurrency_id: str | None = None,
121
+ show_api: bool = True) -> Dependency:
122
+ """
123
+ Parameters:
124
+ fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
125
+ inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
126
+ outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
127
+ api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
128
+ scroll_to_output: If True, will scroll to output component on completion
129
+ show_progress: If True, will show progress animation while pending
130
+ queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
131
+ batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
132
+ max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
133
+ preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
134
+ postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
135
+ cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
136
+ every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds.
137
+ trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.
138
+ js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
139
+ concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
140
+ concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
141
+ show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
142
+ """
143
+ ...
144
+
145
+ def upload(self,
146
+ fn: Callable | None,
147
+ inputs: Component | Sequence[Component] | set[Component] | None = None,
148
+ outputs: Component | Sequence[Component] | None = None,
149
+ api_name: str | None | Literal[False] = None,
150
+ scroll_to_output: bool = False,
151
+ show_progress: Literal["full", "minimal", "hidden"] = "full",
152
+ queue: bool | None = None,
153
+ batch: bool = False,
154
+ max_batch_size: int = 4,
155
+ preprocess: bool = True,
156
+ postprocess: bool = True,
157
+ cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
158
+ every: float | None = None,
159
+ trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
160
+ js: str | None = None,
161
+ concurrency_limit: int | None | Literal["default"] = "default",
162
+ concurrency_id: str | None = None,
163
+ show_api: bool = True) -> Dependency:
164
+ """
165
+ Parameters:
166
+ fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
167
+ inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
168
+ outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
169
+ api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
170
+ scroll_to_output: If True, will scroll to output component on completion
171
+ show_progress: If True, will show progress animation while pending
172
+ queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
173
+ batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
174
+ max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
175
+ preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
176
+ postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
177
+ cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
178
+ every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds.
179
+ trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.
180
+ js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
181
+ concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
182
+ concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
183
+ show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
184
+ """
185
+ ...
186
+
187
+ def edit(self,
188
+ fn: Callable | None,
189
+ inputs: Component | Sequence[Component] | set[Component] | None = None,
190
+ outputs: Component | Sequence[Component] | None = None,
191
+ api_name: str | None | Literal[False] = None,
192
+ scroll_to_output: bool = False,
193
+ show_progress: Literal["full", "minimal", "hidden"] = "full",
194
+ queue: bool | None = None,
195
+ batch: bool = False,
196
+ max_batch_size: int = 4,
197
+ preprocess: bool = True,
198
+ postprocess: bool = True,
199
+ cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
200
+ every: float | None = None,
201
+ trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
202
+ js: str | None = None,
203
+ concurrency_limit: int | None | Literal["default"] = "default",
204
+ concurrency_id: str | None = None,
205
+ show_api: bool = True) -> Dependency:
206
+ """
207
+ Parameters:
208
+ fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
209
+ inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
210
+ outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
211
+ api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
212
+ scroll_to_output: If True, will scroll to output component on completion
213
+ show_progress: If True, will show progress animation while pending
214
+ queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
215
+ batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
216
+ max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
217
+ preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
218
+ postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
219
+ cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
220
+ every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds.
221
+ trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.
222
+ js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
223
+ concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
224
+ concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
225
+ show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
226
+ """
227
+ ...
228
+
229
+ def clear(self,
230
+ fn: Callable | None,
231
+ inputs: Component | Sequence[Component] | set[Component] | None = None,
232
+ outputs: Component | Sequence[Component] | None = None,
233
+ api_name: str | None | Literal[False] = None,
234
+ scroll_to_output: bool = False,
235
+ show_progress: Literal["full", "minimal", "hidden"] = "full",
236
+ queue: bool | None = None,
237
+ batch: bool = False,
238
+ max_batch_size: int = 4,
239
+ preprocess: bool = True,
240
+ postprocess: bool = True,
241
+ cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
242
+ every: float | None = None,
243
+ trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
244
+ js: str | None = None,
245
+ concurrency_limit: int | None | Literal["default"] = "default",
246
+ concurrency_id: str | None = None,
247
+ show_api: bool = True) -> Dependency:
248
+ """
249
+ Parameters:
250
+ fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
251
+ inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
252
+ outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
253
+ api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
254
+ scroll_to_output: If True, will scroll to output component on completion
255
+ show_progress: If True, will show progress animation while pending
256
+ queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
257
+ batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
258
+ max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
259
+ preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
260
+ postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
261
+ cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
262
+ every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds.
263
+ trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.
264
+ js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
265
+ concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
266
+ concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
267
+ show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
268
+ """
269
+ ...
src/backend/gradio_model4dgs/templates/component/index.js ADDED
The diff for this file is too large to render. See raw diff
 
src/backend/gradio_model4dgs/templates/component/style.css ADDED
@@ -0,0 +1 @@
 
 
1
+ .block.svelte-1t38q2d{position:relative;margin:0;box-shadow:var(--block-shadow);border-width:var(--block-border-width);border-color:var(--block-border-color);border-radius:var(--block-radius);background:var(--block-background-fill);width:100%;line-height:var(--line-sm)}.block.border_focus.svelte-1t38q2d{border-color:var(--color-accent)}.padded.svelte-1t38q2d{padding:var(--block-padding)}.hidden.svelte-1t38q2d{display:none}.hide-container.svelte-1t38q2d{margin:0;box-shadow:none;--block-border-width:0;background:transparent;padding:0;overflow:visible}div.svelte-1hnfib2{margin-bottom:var(--spacing-lg);color:var(--block-info-text-color);font-weight:var(--block-info-text-weight);font-size:var(--block-info-text-size);line-height:var(--line-sm)}span.has-info.svelte-22c38v{margin-bottom:var(--spacing-xs)}span.svelte-22c38v:not(.has-info){margin-bottom:var(--spacing-lg)}span.svelte-22c38v{display:inline-block;position:relative;z-index:var(--layer-4);border:solid var(--block-title-border-width) var(--block-title-border-color);border-radius:var(--block-title-radius);background:var(--block-title-background-fill);padding:var(--block-title-padding);color:var(--block-title-text-color);font-weight:var(--block-title-text-weight);font-size:var(--block-title-text-size);line-height:var(--line-sm)}.hide.svelte-22c38v{margin:0;height:0}label.svelte-9gxdi0{display:inline-flex;align-items:center;z-index:var(--layer-2);box-shadow:var(--block-label-shadow);border:var(--block-label-border-width) solid var(--border-color-primary);border-top:none;border-left:none;border-radius:var(--block-label-radius);background:var(--block-label-background-fill);padding:var(--block-label-padding);pointer-events:none;color:var(--block-label-text-color);font-weight:var(--block-label-text-weight);font-size:var(--block-label-text-size);line-height:var(--line-sm)}.gr-group label.svelte-9gxdi0{border-top-left-radius:0}label.float.svelte-9gxdi0{position:absolute;top:var(--block-label-margin);left:var(--block-label-margin)}label.svelte-9gxdi0:not(.float){position:static;margin-top:var(--block-label-margin);margin-left:var(--block-label-margin)}.hide.svelte-9gxdi0{height:0}span.svelte-9gxdi0{opacity:.8;margin-right:var(--size-2);width:calc(var(--block-label-text-size) - 1px);height:calc(var(--block-label-text-size) - 1px)}.hide-label.svelte-9gxdi0{box-shadow:none;border-width:0;background:transparent;overflow:visible}button.svelte-lpi64a{display:flex;justify-content:center;align-items:center;gap:1px;z-index:var(--layer-2);border-radius:var(--radius-sm);color:var(--block-label-text-color);border:1px solid transparent}button[disabled].svelte-lpi64a{opacity:.5;box-shadow:none}button[disabled].svelte-lpi64a:hover{cursor:not-allowed}.padded.svelte-lpi64a{padding:2px;background:var(--bg-color);box-shadow:var(--shadow-drop);border:1px solid var(--button-secondary-border-color)}button.svelte-lpi64a:hover,button.highlight.svelte-lpi64a{cursor:pointer;color:var(--color-accent)}.padded.svelte-lpi64a:hover{border:2px solid var(--button-secondary-border-color-hover);padding:1px;color:var(--block-label-text-color)}span.svelte-lpi64a{padding:0 1px;font-size:10px}div.svelte-lpi64a{padding:2px;display:flex;align-items:flex-end}.small.svelte-lpi64a{width:14px;height:14px}.large.svelte-lpi64a{width:22px;height:22px}.pending.svelte-lpi64a{animation:svelte-lpi64a-flash .5s infinite}@keyframes svelte-lpi64a-flash{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.transparent.svelte-lpi64a{background:transparent;border:none;box-shadow:none}.empty.svelte-3w3rth{display:flex;justify-content:center;align-items:center;margin-top:calc(0px - var(--size-6));height:var(--size-full)}.icon.svelte-3w3rth{opacity:.5;height:var(--size-5);color:var(--body-text-color)}.small.svelte-3w3rth{min-height:calc(var(--size-32) - 20px)}.large.svelte-3w3rth{min-height:calc(var(--size-64) - 20px)}.unpadded_box.svelte-3w3rth{margin-top:0}.small_parent.svelte-3w3rth{min-height:100%!important}.dropdown-arrow.svelte-145leq6{fill:currentColor}.wrap.svelte-kzcjhc{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:var(--size-60);color:var(--block-label-text-color);line-height:var(--line-md);height:100%;padding-top:var(--size-3)}.or.svelte-kzcjhc{color:var(--body-text-color-subdued);display:flex}.icon-wrap.svelte-kzcjhc{width:30px;margin-bottom:var(--spacing-lg)}@media (--screen-md){.wrap.svelte-kzcjhc{font-size:var(--text-lg)}}.hovered.svelte-kzcjhc{color:var(--color-accent)}div.svelte-ipfyu7{border-top:1px solid transparent;display:flex;max-height:100%;justify-content:center;gap:var(--spacing-sm);height:auto;align-items:flex-end;padding-bottom:var(--spacing-xl);color:var(--block-label-text-color);flex-shrink:0;width:95%}.show_border.svelte-ipfyu7{border-top:1px solid var(--block-border-color);margin-top:var(--spacing-xxl);box-shadow:var(--shadow-drop)}.source-selection.svelte-1jp3vgd{display:flex;align-items:center;justify-content:center;border-top:1px solid var(--border-color-primary);width:95%;bottom:0;left:0;right:0;margin-left:auto;margin-right:auto}.icon.svelte-1jp3vgd{width:22px;height:22px;margin:var(--spacing-lg) var(--spacing-xs);padding:var(--spacing-xs);color:var(--neutral-400);border-radius:var(--radius-md)}.selected.svelte-1jp3vgd{color:var(--color-accent)}.icon.svelte-1jp3vgd:hover,.icon.svelte-1jp3vgd:focus{color:var(--color-accent)}.model4DGS.svelte-jfv6j3{display:flex;position:relative;width:var(--size-full);height:var(--size-full);min-height:250px}svg.svelte-43sxxs.svelte-43sxxs{width:var(--size-20);height:var(--size-20)}svg.svelte-43sxxs path.svelte-43sxxs{fill:var(--loader-color)}div.svelte-43sxxs.svelte-43sxxs{z-index:var(--layer-2)}.margin.svelte-43sxxs.svelte-43sxxs{margin:var(--size-4)}.wrap.svelte-1txqlrd.svelte-1txqlrd{display:flex;flex-direction:column;justify-content:center;align-items:center;z-index:var(--layer-top);transition:opacity .1s ease-in-out;border-radius:var(--block-radius);background:var(--block-background-fill);padding:0 var(--size-6);max-height:var(--size-screen-h);overflow:hidden;pointer-events:none}.wrap.center.svelte-1txqlrd.svelte-1txqlrd{top:0;right:0;left:0}.wrap.default.svelte-1txqlrd.svelte-1txqlrd{top:0;right:0;bottom:0;left:0}.hide.svelte-1txqlrd.svelte-1txqlrd{opacity:0;pointer-events:none}.generating.svelte-1txqlrd.svelte-1txqlrd{animation:svelte-1txqlrd-pulse 2s cubic-bezier(.4,0,.6,1) infinite;border:2px solid var(--color-accent);background:transparent}.translucent.svelte-1txqlrd.svelte-1txqlrd{background:none}@keyframes svelte-1txqlrd-pulse{0%,to{opacity:1}50%{opacity:.5}}.loading.svelte-1txqlrd.svelte-1txqlrd{z-index:var(--layer-2);color:var(--body-text-color)}.eta-bar.svelte-1txqlrd.svelte-1txqlrd{position:absolute;top:0;right:0;bottom:0;left:0;transform-origin:left;opacity:.8;z-index:var(--layer-1);transition:10ms;background:var(--background-fill-secondary)}.progress-bar-wrap.svelte-1txqlrd.svelte-1txqlrd{border:1px solid var(--border-color-primary);background:var(--background-fill-primary);width:55.5%;height:var(--size-4)}.progress-bar.svelte-1txqlrd.svelte-1txqlrd{transform-origin:left;background-color:var(--loader-color);width:var(--size-full);height:var(--size-full)}.progress-level.svelte-1txqlrd.svelte-1txqlrd{display:flex;flex-direction:column;align-items:center;gap:1;z-index:var(--layer-2);width:var(--size-full)}.progress-level-inner.svelte-1txqlrd.svelte-1txqlrd{margin:var(--size-2) auto;color:var(--body-text-color);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text.svelte-1txqlrd.svelte-1txqlrd{position:absolute;top:0;right:0;z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text-center.svelte-1txqlrd.svelte-1txqlrd{display:flex;position:absolute;top:0;right:0;justify-content:center;align-items:center;transform:translateY(var(--size-6));z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono);text-align:center}.error.svelte-1txqlrd.svelte-1txqlrd{box-shadow:var(--shadow-drop);border:solid 1px var(--error-border-color);border-radius:var(--radius-full);background:var(--error-background-fill);padding-right:var(--size-4);padding-left:var(--size-4);color:var(--error-text-color);font-weight:var(--weight-semibold);font-size:var(--text-lg);line-height:var(--line-lg);font-family:var(--font)}.minimal.svelte-1txqlrd .progress-text.svelte-1txqlrd{background:var(--block-background-fill)}.border.svelte-1txqlrd.svelte-1txqlrd{border:1px solid var(--border-color-primary)}.toast-body.svelte-solcu7{display:flex;position:relative;right:0;left:0;align-items:center;margin:var(--size-6) var(--size-4);margin:auto;border-radius:var(--container-radius);overflow:hidden;pointer-events:auto}.toast-body.error.svelte-solcu7{border:1px solid var(--color-red-700);background:var(--color-red-50)}.dark .toast-body.error.svelte-solcu7{border:1px solid var(--color-red-500);background-color:var(--color-grey-950)}.toast-body.warning.svelte-solcu7{border:1px solid var(--color-yellow-700);background:var(--color-yellow-50)}.dark .toast-body.warning.svelte-solcu7{border:1px solid var(--color-yellow-500);background-color:var(--color-grey-950)}.toast-body.info.svelte-solcu7{border:1px solid var(--color-grey-700);background:var(--color-grey-50)}.dark .toast-body.info.svelte-solcu7{border:1px solid var(--color-grey-500);background-color:var(--color-grey-950)}.toast-title.svelte-solcu7{display:flex;align-items:center;font-weight:var(--weight-bold);font-size:var(--text-lg);line-height:var(--line-sm);text-transform:capitalize}.toast-title.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-title.error.svelte-solcu7{color:var(--color-red-50)}.toast-title.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-title.warning.svelte-solcu7{color:var(--color-yellow-50)}.toast-title.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-title.info.svelte-solcu7{color:var(--color-grey-50)}.toast-close.svelte-solcu7{margin:0 var(--size-3);border-radius:var(--size-3);padding:0px var(--size-1-5);font-size:var(--size-5);line-height:var(--size-5)}.toast-close.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-close.error.svelte-solcu7{color:var(--color-red-500)}.toast-close.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-close.warning.svelte-solcu7{color:var(--color-yellow-500)}.toast-close.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-close.info.svelte-solcu7{color:var(--color-grey-500)}.toast-text.svelte-solcu7{font-size:var(--text-lg)}.toast-text.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-text.error.svelte-solcu7{color:var(--color-red-50)}.toast-text.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-text.warning.svelte-solcu7{color:var(--color-yellow-50)}.toast-text.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-text.info.svelte-solcu7{color:var(--color-grey-50)}.toast-details.svelte-solcu7{margin:var(--size-3) var(--size-3) var(--size-3) 0;width:100%}.toast-icon.svelte-solcu7{display:flex;position:absolute;position:relative;flex-shrink:0;justify-content:center;align-items:center;margin:var(--size-2);border-radius:var(--radius-full);padding:var(--size-1);padding-left:calc(var(--size-1) - 1px);width:35px;height:35px}.toast-icon.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-icon.error.svelte-solcu7{color:var(--color-red-500)}.toast-icon.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-icon.warning.svelte-solcu7{color:var(--color-yellow-500)}.toast-icon.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-icon.info.svelte-solcu7{color:var(--color-grey-500)}@keyframes svelte-solcu7-countdown{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.timer.svelte-solcu7{position:absolute;bottom:0;left:0;transform-origin:0 0;animation:svelte-solcu7-countdown 10s linear forwards;width:100%;height:var(--size-1)}.timer.error.svelte-solcu7{background:var(--color-red-700)}.dark .timer.error.svelte-solcu7{background:var(--color-red-500)}.timer.warning.svelte-solcu7{background:var(--color-yellow-700)}.dark .timer.warning.svelte-solcu7{background:var(--color-yellow-500)}.timer.info.svelte-solcu7{background:var(--color-grey-700)}.dark .timer.info.svelte-solcu7{background:var(--color-grey-500)}.toast-wrap.svelte-gatr8h{display:flex;position:fixed;top:var(--size-4);right:var(--size-4);flex-direction:column;align-items:end;gap:var(--size-2);z-index:var(--layer-top);width:calc(100% - var(--size-8))}@media (--screen-sm){.toast-wrap.svelte-gatr8h{width:calc(var(--size-96) + var(--size-10))}}.gallery.svelte-1gecy8w{padding:var(--size-1) var(--size-2)}
src/backend/gradio_model4dgs/templates/example/index.js ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const {
2
+ SvelteComponent: f,
3
+ append: u,
4
+ attr: d,
5
+ detach: g,
6
+ element: o,
7
+ init: v,
8
+ insert: r,
9
+ noop: c,
10
+ safe_not_equal: y,
11
+ set_data: m,
12
+ text: b,
13
+ toggle_class: i
14
+ } = window.__gradio__svelte__internal;
15
+ function w(a) {
16
+ let e, n;
17
+ return {
18
+ c() {
19
+ e = o("div"), n = b(
20
+ /*value*/
21
+ a[0]
22
+ ), d(e, "class", "svelte-1gecy8w"), i(
23
+ e,
24
+ "table",
25
+ /*type*/
26
+ a[1] === "table"
27
+ ), i(
28
+ e,
29
+ "gallery",
30
+ /*type*/
31
+ a[1] === "gallery"
32
+ ), i(
33
+ e,
34
+ "selected",
35
+ /*selected*/
36
+ a[2]
37
+ );
38
+ },
39
+ m(t, l) {
40
+ r(t, e, l), u(e, n);
41
+ },
42
+ p(t, [l]) {
43
+ l & /*value*/
44
+ 1 && m(
45
+ n,
46
+ /*value*/
47
+ t[0]
48
+ ), l & /*type*/
49
+ 2 && i(
50
+ e,
51
+ "table",
52
+ /*type*/
53
+ t[1] === "table"
54
+ ), l & /*type*/
55
+ 2 && i(
56
+ e,
57
+ "gallery",
58
+ /*type*/
59
+ t[1] === "gallery"
60
+ ), l & /*selected*/
61
+ 4 && i(
62
+ e,
63
+ "selected",
64
+ /*selected*/
65
+ t[2]
66
+ );
67
+ },
68
+ i: c,
69
+ o: c,
70
+ d(t) {
71
+ t && g(e);
72
+ }
73
+ };
74
+ }
75
+ function h(a, e, n) {
76
+ let { value: t } = e, { type: l } = e, { selected: _ = !1 } = e;
77
+ return a.$$set = (s) => {
78
+ "value" in s && n(0, t = s.value), "type" in s && n(1, l = s.type), "selected" in s && n(2, _ = s.selected);
79
+ }, [t, l, _];
80
+ }
81
+ class E extends f {
82
+ constructor(e) {
83
+ super(), v(this, e, h, w, y, { value: 0, type: 1, selected: 2 });
84
+ }
85
+ }
86
+ export {
87
+ E as default
88
+ };
src/backend/gradio_model4dgs/templates/example/style.css ADDED
@@ -0,0 +1 @@
 
 
1
+ .gallery.svelte-1gecy8w{padding:var(--size-1) var(--size-2)}
src/demo/__init__.py ADDED
File without changes
src/demo/app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from gradio_model4dgs import Model4DGS
3
+ import os
4
+
5
+ image_dir = os.path.join(os.path.dirname(__file__), "assets")
6
+
7
+ if os.path.exists(image_dir) and os.path.isdir(image_dir) and os.listdir(image_dir):
8
+ examples = [os.path.join(image_dir, file) for file in os.listdir(image_dir)]
9
+ else:
10
+ examples = [os.path.join(os.path.dirname(__file__), example) for example in Model4DGS().example_inputs()]
11
+
12
+ with gr.Blocks() as demo:
13
+ with gr.Row():
14
+ Model4DGS(value=examples, label="4D Model")
15
+
16
+ if __name__ == "__main__":
17
+ demo.launch(share=True)
src/demo/assets/tiger_4d_model_0.ply ADDED
Binary file (715 kB). View file
 
src/demo/assets/tiger_4d_model_1.ply ADDED
Binary file (715 kB). View file
 
src/demo/assets/tiger_4d_model_10.ply ADDED
Binary file (715 kB). View file
 
src/demo/assets/tiger_4d_model_11.ply ADDED
Binary file (715 kB). View file
 
src/demo/assets/tiger_4d_model_12.ply ADDED
Binary file (715 kB). View file
 
src/demo/assets/tiger_4d_model_13.ply ADDED
Binary file (715 kB). View file
 
src/demo/assets/tiger_4d_model_2.ply ADDED
Binary file (715 kB). View file
 
src/demo/assets/tiger_4d_model_3.ply ADDED
Binary file (715 kB). View file
 
src/demo/assets/tiger_4d_model_4.ply ADDED
Binary file (715 kB). View file
 
src/demo/assets/tiger_4d_model_5.ply ADDED
Binary file (715 kB). View file
 
src/demo/assets/tiger_4d_model_6.ply ADDED
Binary file (715 kB). View file
 
src/demo/assets/tiger_4d_model_7.ply ADDED
Binary file (715 kB). View file
 
src/demo/assets/tiger_4d_model_8.ply ADDED
Binary file (715 kB). View file
 
src/demo/assets/tiger_4d_model_9.ply ADDED
Binary file (715 kB). View file
 
src/demo/css.css ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ html {
2
+ font-family: Inter;
3
+ font-size: 16px;
4
+ font-weight: 400;
5
+ line-height: 1.5;
6
+ -webkit-text-size-adjust: 100%;
7
+ background: #fff;
8
+ color: #323232;
9
+ -webkit-font-smoothing: antialiased;
10
+ -moz-osx-font-smoothing: grayscale;
11
+ text-rendering: optimizeLegibility;
12
+ }
13
+
14
+ :root {
15
+ --space: 1;
16
+ --vspace: calc(var(--space) * 1rem);
17
+ --vspace-0: calc(3 * var(--space) * 1rem);
18
+ --vspace-1: calc(2 * var(--space) * 1rem);
19
+ --vspace-2: calc(1.5 * var(--space) * 1rem);
20
+ --vspace-3: calc(0.5 * var(--space) * 1rem);
21
+ }
22
+
23
+ .app {
24
+ max-width: 748px !important;
25
+ }
26
+
27
+ .prose p {
28
+ margin: var(--vspace) 0;
29
+ line-height: var(--vspace * 2);
30
+ font-size: 1rem;
31
+ }
32
+
33
+ code {
34
+ font-family: "Inconsolata", sans-serif;
35
+ font-size: 16px;
36
+ }
37
+
38
+ h1,
39
+ h1 code {
40
+ font-weight: 400;
41
+ line-height: calc(2.5 / var(--space) * var(--vspace));
42
+ }
43
+
44
+ h1 code {
45
+ background: none;
46
+ border: none;
47
+ letter-spacing: 0.05em;
48
+ padding-bottom: 5px;
49
+ position: relative;
50
+ padding: 0;
51
+ }
52
+
53
+ h2 {
54
+ margin: var(--vspace-1) 0 var(--vspace-2) 0;
55
+ line-height: 1em;
56
+ }
57
+
58
+ h3,
59
+ h3 code {
60
+ margin: var(--vspace-1) 0 var(--vspace-2) 0;
61
+ line-height: 1em;
62
+ }
63
+
64
+ h4,
65
+ h5,
66
+ h6 {
67
+ margin: var(--vspace-3) 0 var(--vspace-3) 0;
68
+ line-height: var(--vspace);
69
+ }
70
+
71
+ .bigtitle,
72
+ h1,
73
+ h1 code {
74
+ font-size: calc(8px * 4.5);
75
+ word-break: break-word;
76
+ }
77
+
78
+ .title,
79
+ h2,
80
+ h2 code {
81
+ font-size: calc(8px * 3.375);
82
+ font-weight: lighter;
83
+ word-break: break-word;
84
+ border: none;
85
+ background: none;
86
+ }
87
+
88
+ .subheading1,
89
+ h3,
90
+ h3 code {
91
+ font-size: calc(8px * 1.8);
92
+ font-weight: 600;
93
+ border: none;
94
+ background: none;
95
+ letter-spacing: 0.1em;
96
+ text-transform: uppercase;
97
+ }
98
+
99
+ h2 code {
100
+ padding: 0;
101
+ position: relative;
102
+ letter-spacing: 0.05em;
103
+ }
104
+
105
+ blockquote {
106
+ font-size: calc(8px * 1.1667);
107
+ font-style: italic;
108
+ line-height: calc(1.1667 * var(--vspace));
109
+ margin: var(--vspace-2) var(--vspace-2);
110
+ }
111
+
112
+ .subheading2,
113
+ h4 {
114
+ font-size: calc(8px * 1.4292);
115
+ text-transform: uppercase;
116
+ font-weight: 600;
117
+ }
118
+
119
+ .subheading3,
120
+ h5 {
121
+ font-size: calc(8px * 1.2917);
122
+ line-height: calc(1.2917 * var(--vspace));
123
+
124
+ font-weight: lighter;
125
+ text-transform: uppercase;
126
+ letter-spacing: 0.15em;
127
+ }
128
+
129
+ h6 {
130
+ font-size: calc(8px * 1.1667);
131
+ font-size: 1.1667em;
132
+ font-weight: normal;
133
+ font-style: italic;
134
+ font-family: "le-monde-livre-classic-byol", serif !important;
135
+ letter-spacing: 0px !important;
136
+ }
137
+
138
+ #start .md > *:first-child {
139
+ margin-top: 0;
140
+ }
141
+
142
+ h2 + h3 {
143
+ margin-top: 0;
144
+ }
145
+
146
+ .md hr {
147
+ border: none;
148
+ border-top: 1px solid var(--block-border-color);
149
+ margin: var(--vspace-2) 0 var(--vspace-2) 0;
150
+ }
151
+ .prose ul {
152
+ margin: var(--vspace-2) 0 var(--vspace-1) 0;
153
+ }
154
+
155
+ .gap {
156
+ gap: 0;
157
+ }
src/demo/space.py ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import gradio as gr
3
+ from app import demo as app
4
+ import os
5
+
6
+ _docs = {'Model4DGS': {'description': 'Component allows users to upload or view 4D Gaussian Splatting files (.splat).', 'members': {'__init__': {'value': {'type': 'str | Callable | None', 'default': 'None', 'description': 'path to (.splat) file to show in model4DGS viewer. If callable, the function will be called whenever the app loads to set the initial value of the component.'}, 'height': {'type': 'int | None', 'default': 'None', 'description': 'height of the model4DGS component, in pixels.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': None}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': None}, 'every': {'type': 'float | None', 'default': 'None', 'description': None}, 'container': {'type': 'bool', 'default': 'True', 'description': None}, 'scale': {'type': 'int | None', 'default': 'None', 'description': None}, 'min_width': {'type': 'int', 'default': '160', 'description': None}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': None}, 'visible': {'type': 'bool', 'default': 'True', 'description': None}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': None}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': None}, 'render': {'type': 'bool', 'default': 'True', 'description': None}}, 'postprocess': {'value': {'type': 'List[str] | str | None', 'description': "The output data received by the component from the user's function in the backend."}}, 'preprocess': {'return': {'type': 'List[str] | None', 'description': "The preprocessed input data sent to the user's function in the backend."}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the Model4DGS changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'upload': {'type': None, 'default': None, 'description': 'This listener is triggered when the user uploads a file into the Model4DGS.'}, 'edit': {'type': None, 'default': None, 'description': 'This listener is triggered when the user edits the Model4DGS (e.g. image) using the built-in editor.'}, 'clear': {'type': None, 'default': None, 'description': 'This listener is triggered when the user clears the Model4DGS using the X button for the component.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'Model4DGS': []}}}
7
+
8
+ abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
+
10
+ with gr.Blocks(
11
+ css=abs_path,
12
+ theme=gr.themes.Default(
13
+ font_mono=[
14
+ gr.themes.GoogleFont("Inconsolata"),
15
+ "monospace",
16
+ ],
17
+ ),
18
+ ) as demo:
19
+ gr.Markdown(
20
+ """
21
+ # `gradio_model4dgs`
22
+
23
+ <div style="display: flex; gap: 7px;">
24
+ <a href="https://pypi.org/project/gradio_model4dgs/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_model4dgs"></a>
25
+ </div>
26
+
27
+ Python library for easily interacting with trained machine learning models
28
+ """, elem_classes=["md-custom"], header_links=True)
29
+ app.render()
30
+ gr.Markdown(
31
+ """
32
+ ## Installation
33
+
34
+ ```bash
35
+ pip install gradio_model4dgs
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ```python
41
+ import gradio as gr
42
+ from gradio_model4dgs import Model4DGS
43
+ import os
44
+
45
+ image_dir = os.path.join(os.path.dirname(__file__), "assets")
46
+
47
+ if os.path.exists(image_dir) and os.path.isdir(image_dir) and os.listdir(image_dir):
48
+ examples = [os.path.join(image_dir, file) for file in os.listdir(image_dir)]
49
+ else:
50
+ examples = [os.path.join(os.path.dirname(__file__), example) for example in Model4DGS().example_inputs()]
51
+
52
+ with gr.Blocks() as demo:
53
+ with gr.Row():
54
+ Model4DGS(value=examples, label="4D Model")
55
+
56
+ if __name__ == "__main__":
57
+ demo.launch(share=True)
58
+ ```
59
+ """, elem_classes=["md-custom"], header_links=True)
60
+
61
+
62
+ gr.Markdown("""
63
+ ## `Model4DGS`
64
+
65
+ ### Initialization
66
+ """, elem_classes=["md-custom"], header_links=True)
67
+
68
+ gr.ParamViewer(value=_docs["Model4DGS"]["members"]["__init__"], linkify=[])
69
+
70
+
71
+ gr.Markdown("### Events")
72
+ gr.ParamViewer(value=_docs["Model4DGS"]["events"], linkify=['Event'])
73
+
74
+
75
+
76
+
77
+ gr.Markdown("""
78
+
79
+ ### User function
80
+
81
+ The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
82
+
83
+ - When used as an Input, the component only impacts the input signature of the user function.
84
+ - When used as an output, the component only impacts the return signature of the user function.
85
+
86
+ The code snippet below is accurate in cases where the component is used as both an input and an output.
87
+
88
+ - **As input:** Is passed, the preprocessed input data sent to the user's function in the backend.
89
+ - **As output:** Should return, the output data received by the component from the user's function in the backend.
90
+
91
+ ```python
92
+ def predict(
93
+ value: List[str] | None
94
+ ) -> List[str] | str | None:
95
+ return value
96
+ ```
97
+ """, elem_classes=["md-custom", "Model4DGS-user-fn"], header_links=True)
98
+
99
+
100
+
101
+
102
+ demo.load(None, js=r"""function() {
103
+ const refs = {};
104
+ const user_fn_refs = {
105
+ Model4DGS: [], };
106
+ requestAnimationFrame(() => {
107
+
108
+ Object.entries(user_fn_refs).forEach(([key, refs]) => {
109
+ if (refs.length > 0) {
110
+ const el = document.querySelector(`.${key}-user-fn`);
111
+ if (!el) return;
112
+ refs.forEach(ref => {
113
+ el.innerHTML = el.innerHTML.replace(
114
+ new RegExp("\\b"+ref+"\\b", "g"),
115
+ `<a href="#h-${ref.toLowerCase()}">${ref}</a>`
116
+ );
117
+ })
118
+ }
119
+ })
120
+
121
+ Object.entries(refs).forEach(([key, refs]) => {
122
+ if (refs.length > 0) {
123
+ const el = document.querySelector(`.${key}`);
124
+ if (!el) return;
125
+ refs.forEach(ref => {
126
+ el.innerHTML = el.innerHTML.replace(
127
+ new RegExp("\\b"+ref+"\\b", "g"),
128
+ `<a href="#h-${ref.toLowerCase()}">${ref}</a>`
129
+ );
130
+ })
131
+ }
132
+ })
133
+ })
134
+ }
135
+
136
+ """)
137
+
138
+ demo.launch()
src/demo/tiger_rgba.png ADDED
src/frontend/Example.svelte ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script lang="ts">
2
+ export let value: string;
3
+ export let type: "gallery" | "table";
4
+ export let selected = false;
5
+ </script>
6
+
7
+ <div
8
+ class:table={type === "table"}
9
+ class:gallery={type === "gallery"}
10
+ class:selected
11
+ >
12
+ {value}
13
+ </div>
14
+
15
+ <style>
16
+ .gallery {
17
+ padding: var(--size-1) var(--size-2);
18
+ }
19
+ </style>
src/frontend/Index.svelte ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script context="module" lang="ts">
2
+ export { default as BaseModel4DGS } from "./shared/Model4DGS.svelte";
3
+ export { default as BaseExample } from "./Example.svelte";
4
+ </script>
5
+
6
+ <script lang="ts">
7
+ import type { FileData } from "@gradio/client";
8
+ import Model4DGS from "./shared/Model4DGS.svelte";
9
+ import { BlockLabel, Block, Empty } from "@gradio/atoms";
10
+ import { File } from "@gradio/icons";
11
+ import { StatusTracker } from "@gradio/statustracker";
12
+ import type { LoadingStatus } from "@gradio/statustracker";
13
+ import type { Gradio } from "@gradio/utils";
14
+
15
+ export let elem_id = "";
16
+ export let elem_classes: string[] = [];
17
+ export let visible = true;
18
+ export let value: null | { files: FileData[]; } = null;
19
+ export let root: string;
20
+ export let proxy_url: null | string;
21
+ export let loading_status: LoadingStatus;
22
+ export let label: string;
23
+ export let show_label: boolean;
24
+ export let container = true;
25
+ export let scale: number | null = null;
26
+ export let min_width: number | undefined = undefined;
27
+ export let gradio: Gradio;
28
+ export let height: number | undefined = undefined;
29
+
30
+ let dragging = false;
31
+ </script>
32
+
33
+ <Block
34
+ {visible}
35
+ variant={value === null ? "dashed" : "solid"}
36
+ border_mode={dragging ? "focus" : "base"}
37
+ padding={false}
38
+ {elem_id}
39
+ {elem_classes}
40
+ {container}
41
+ {scale}
42
+ {min_width}
43
+ {height}
44
+ >
45
+ <StatusTracker autoscroll={gradio.autoscroll} i18n={gradio.i18n} {...loading_status} />
46
+
47
+ {#if value}
48
+ <BlockLabel {show_label} Icon={File} label={label || "Splat"} />
49
+ <Model4DGS
50
+ bind:value
51
+ i18n={gradio.i18n}
52
+ {label}
53
+ {show_label}
54
+ {root}
55
+ {proxy_url}
56
+ />
57
+ {:else}
58
+ <BlockLabel {show_label} Icon={File} label={label || "Splat"} />
59
+
60
+ <Empty unpadded_box={true} size="large"><File /></Empty>
61
+ {/if}
62
+ </Block>
src/frontend/package-lock.json ADDED
@@ -0,0 +1,1051 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "gradio_model4dgs",
3
+ "version": "0.0.1",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "gradio_model4dgs",
9
+ "version": "0.0.1",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "@gradio/atoms": "0.5.0",
13
+ "@gradio/client": "0.10.1",
14
+ "@gradio/statustracker": "0.4.4",
15
+ "@gradio/utils": "0.2.1",
16
+ "@mkkellogg/gaussian-splats-3d": "^0.2.3",
17
+ "three": "^0.162.0"
18
+ }
19
+ },
20
+ "node_modules/@ampproject/remapping": {
21
+ "version": "2.2.1",
22
+ "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
23
+ "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==",
24
+ "peer": true,
25
+ "dependencies": {
26
+ "@jridgewell/gen-mapping": "^0.3.0",
27
+ "@jridgewell/trace-mapping": "^0.3.9"
28
+ },
29
+ "engines": {
30
+ "node": ">=6.0.0"
31
+ }
32
+ },
33
+ "node_modules/@esbuild/aix-ppc64": {
34
+ "version": "0.19.12",
35
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz",
36
+ "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==",
37
+ "cpu": [
38
+ "ppc64"
39
+ ],
40
+ "optional": true,
41
+ "os": [
42
+ "aix"
43
+ ],
44
+ "engines": {
45
+ "node": ">=12"
46
+ }
47
+ },
48
+ "node_modules/@esbuild/android-arm": {
49
+ "version": "0.19.12",
50
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz",
51
+ "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==",
52
+ "cpu": [
53
+ "arm"
54
+ ],
55
+ "optional": true,
56
+ "os": [
57
+ "android"
58
+ ],
59
+ "engines": {
60
+ "node": ">=12"
61
+ }
62
+ },
63
+ "node_modules/@esbuild/android-arm64": {
64
+ "version": "0.19.12",
65
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz",
66
+ "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==",
67
+ "cpu": [
68
+ "arm64"
69
+ ],
70
+ "optional": true,
71
+ "os": [
72
+ "android"
73
+ ],
74
+ "engines": {
75
+ "node": ">=12"
76
+ }
77
+ },
78
+ "node_modules/@esbuild/android-x64": {
79
+ "version": "0.19.12",
80
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz",
81
+ "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==",
82
+ "cpu": [
83
+ "x64"
84
+ ],
85
+ "optional": true,
86
+ "os": [
87
+ "android"
88
+ ],
89
+ "engines": {
90
+ "node": ">=12"
91
+ }
92
+ },
93
+ "node_modules/@esbuild/darwin-arm64": {
94
+ "version": "0.19.12",
95
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz",
96
+ "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==",
97
+ "cpu": [
98
+ "arm64"
99
+ ],
100
+ "optional": true,
101
+ "os": [
102
+ "darwin"
103
+ ],
104
+ "engines": {
105
+ "node": ">=12"
106
+ }
107
+ },
108
+ "node_modules/@esbuild/darwin-x64": {
109
+ "version": "0.19.12",
110
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz",
111
+ "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==",
112
+ "cpu": [
113
+ "x64"
114
+ ],
115
+ "optional": true,
116
+ "os": [
117
+ "darwin"
118
+ ],
119
+ "engines": {
120
+ "node": ">=12"
121
+ }
122
+ },
123
+ "node_modules/@esbuild/freebsd-arm64": {
124
+ "version": "0.19.12",
125
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz",
126
+ "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==",
127
+ "cpu": [
128
+ "arm64"
129
+ ],
130
+ "optional": true,
131
+ "os": [
132
+ "freebsd"
133
+ ],
134
+ "engines": {
135
+ "node": ">=12"
136
+ }
137
+ },
138
+ "node_modules/@esbuild/freebsd-x64": {
139
+ "version": "0.19.12",
140
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz",
141
+ "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==",
142
+ "cpu": [
143
+ "x64"
144
+ ],
145
+ "optional": true,
146
+ "os": [
147
+ "freebsd"
148
+ ],
149
+ "engines": {
150
+ "node": ">=12"
151
+ }
152
+ },
153
+ "node_modules/@esbuild/linux-arm": {
154
+ "version": "0.19.12",
155
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz",
156
+ "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==",
157
+ "cpu": [
158
+ "arm"
159
+ ],
160
+ "optional": true,
161
+ "os": [
162
+ "linux"
163
+ ],
164
+ "engines": {
165
+ "node": ">=12"
166
+ }
167
+ },
168
+ "node_modules/@esbuild/linux-arm64": {
169
+ "version": "0.19.12",
170
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz",
171
+ "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==",
172
+ "cpu": [
173
+ "arm64"
174
+ ],
175
+ "optional": true,
176
+ "os": [
177
+ "linux"
178
+ ],
179
+ "engines": {
180
+ "node": ">=12"
181
+ }
182
+ },
183
+ "node_modules/@esbuild/linux-ia32": {
184
+ "version": "0.19.12",
185
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz",
186
+ "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==",
187
+ "cpu": [
188
+ "ia32"
189
+ ],
190
+ "optional": true,
191
+ "os": [
192
+ "linux"
193
+ ],
194
+ "engines": {
195
+ "node": ">=12"
196
+ }
197
+ },
198
+ "node_modules/@esbuild/linux-loong64": {
199
+ "version": "0.19.12",
200
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz",
201
+ "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==",
202
+ "cpu": [
203
+ "loong64"
204
+ ],
205
+ "optional": true,
206
+ "os": [
207
+ "linux"
208
+ ],
209
+ "engines": {
210
+ "node": ">=12"
211
+ }
212
+ },
213
+ "node_modules/@esbuild/linux-mips64el": {
214
+ "version": "0.19.12",
215
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz",
216
+ "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==",
217
+ "cpu": [
218
+ "mips64el"
219
+ ],
220
+ "optional": true,
221
+ "os": [
222
+ "linux"
223
+ ],
224
+ "engines": {
225
+ "node": ">=12"
226
+ }
227
+ },
228
+ "node_modules/@esbuild/linux-ppc64": {
229
+ "version": "0.19.12",
230
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz",
231
+ "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==",
232
+ "cpu": [
233
+ "ppc64"
234
+ ],
235
+ "optional": true,
236
+ "os": [
237
+ "linux"
238
+ ],
239
+ "engines": {
240
+ "node": ">=12"
241
+ }
242
+ },
243
+ "node_modules/@esbuild/linux-riscv64": {
244
+ "version": "0.19.12",
245
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz",
246
+ "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==",
247
+ "cpu": [
248
+ "riscv64"
249
+ ],
250
+ "optional": true,
251
+ "os": [
252
+ "linux"
253
+ ],
254
+ "engines": {
255
+ "node": ">=12"
256
+ }
257
+ },
258
+ "node_modules/@esbuild/linux-s390x": {
259
+ "version": "0.19.12",
260
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz",
261
+ "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==",
262
+ "cpu": [
263
+ "s390x"
264
+ ],
265
+ "optional": true,
266
+ "os": [
267
+ "linux"
268
+ ],
269
+ "engines": {
270
+ "node": ">=12"
271
+ }
272
+ },
273
+ "node_modules/@esbuild/linux-x64": {
274
+ "version": "0.19.12",
275
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz",
276
+ "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==",
277
+ "cpu": [
278
+ "x64"
279
+ ],
280
+ "optional": true,
281
+ "os": [
282
+ "linux"
283
+ ],
284
+ "engines": {
285
+ "node": ">=12"
286
+ }
287
+ },
288
+ "node_modules/@esbuild/netbsd-x64": {
289
+ "version": "0.19.12",
290
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz",
291
+ "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==",
292
+ "cpu": [
293
+ "x64"
294
+ ],
295
+ "optional": true,
296
+ "os": [
297
+ "netbsd"
298
+ ],
299
+ "engines": {
300
+ "node": ">=12"
301
+ }
302
+ },
303
+ "node_modules/@esbuild/openbsd-x64": {
304
+ "version": "0.19.12",
305
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz",
306
+ "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==",
307
+ "cpu": [
308
+ "x64"
309
+ ],
310
+ "optional": true,
311
+ "os": [
312
+ "openbsd"
313
+ ],
314
+ "engines": {
315
+ "node": ">=12"
316
+ }
317
+ },
318
+ "node_modules/@esbuild/sunos-x64": {
319
+ "version": "0.19.12",
320
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz",
321
+ "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==",
322
+ "cpu": [
323
+ "x64"
324
+ ],
325
+ "optional": true,
326
+ "os": [
327
+ "sunos"
328
+ ],
329
+ "engines": {
330
+ "node": ">=12"
331
+ }
332
+ },
333
+ "node_modules/@esbuild/win32-arm64": {
334
+ "version": "0.19.12",
335
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz",
336
+ "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==",
337
+ "cpu": [
338
+ "arm64"
339
+ ],
340
+ "optional": true,
341
+ "os": [
342
+ "win32"
343
+ ],
344
+ "engines": {
345
+ "node": ">=12"
346
+ }
347
+ },
348
+ "node_modules/@esbuild/win32-ia32": {
349
+ "version": "0.19.12",
350
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz",
351
+ "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==",
352
+ "cpu": [
353
+ "ia32"
354
+ ],
355
+ "optional": true,
356
+ "os": [
357
+ "win32"
358
+ ],
359
+ "engines": {
360
+ "node": ">=12"
361
+ }
362
+ },
363
+ "node_modules/@esbuild/win32-x64": {
364
+ "version": "0.19.12",
365
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz",
366
+ "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==",
367
+ "cpu": [
368
+ "x64"
369
+ ],
370
+ "optional": true,
371
+ "os": [
372
+ "win32"
373
+ ],
374
+ "engines": {
375
+ "node": ">=12"
376
+ }
377
+ },
378
+ "node_modules/@formatjs/ecma402-abstract": {
379
+ "version": "1.11.4",
380
+ "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz",
381
+ "integrity": "sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw==",
382
+ "dependencies": {
383
+ "@formatjs/intl-localematcher": "0.2.25",
384
+ "tslib": "^2.1.0"
385
+ }
386
+ },
387
+ "node_modules/@formatjs/fast-memoize": {
388
+ "version": "1.2.1",
389
+ "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz",
390
+ "integrity": "sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==",
391
+ "dependencies": {
392
+ "tslib": "^2.1.0"
393
+ }
394
+ },
395
+ "node_modules/@formatjs/icu-messageformat-parser": {
396
+ "version": "2.1.0",
397
+ "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz",
398
+ "integrity": "sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw==",
399
+ "dependencies": {
400
+ "@formatjs/ecma402-abstract": "1.11.4",
401
+ "@formatjs/icu-skeleton-parser": "1.3.6",
402
+ "tslib": "^2.1.0"
403
+ }
404
+ },
405
+ "node_modules/@formatjs/icu-skeleton-parser": {
406
+ "version": "1.3.6",
407
+ "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.6.tgz",
408
+ "integrity": "sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg==",
409
+ "dependencies": {
410
+ "@formatjs/ecma402-abstract": "1.11.4",
411
+ "tslib": "^2.1.0"
412
+ }
413
+ },
414
+ "node_modules/@formatjs/intl-localematcher": {
415
+ "version": "0.2.25",
416
+ "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz",
417
+ "integrity": "sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA==",
418
+ "dependencies": {
419
+ "tslib": "^2.1.0"
420
+ }
421
+ },
422
+ "node_modules/@gradio/atoms": {
423
+ "version": "0.5.0",
424
+ "resolved": "https://registry.npmjs.org/@gradio/atoms/-/atoms-0.5.0.tgz",
425
+ "integrity": "sha512-BHDbusMOrmX16lfJdp2EE8ynWPCq8HUGz4fsyLqKzzjo1wR22MKIivjkWt2KVtuWE5foXzyXOWf1MvkhylIgwA==",
426
+ "dependencies": {
427
+ "@gradio/icons": "^0.3.2",
428
+ "@gradio/utils": "^0.2.1"
429
+ }
430
+ },
431
+ "node_modules/@gradio/atoms/node_modules/@gradio/utils": {
432
+ "version": "0.2.2",
433
+ "resolved": "https://registry.npmjs.org/@gradio/utils/-/utils-0.2.2.tgz",
434
+ "integrity": "sha512-dNDvyS8tq9uIdmF3O/0skXhSijGm8MVnfYppGnxS5B2F2HNCFgtD0s8yweGRnKbqLwOi29zb9N8ff1i/NVR7ew==",
435
+ "dependencies": {
436
+ "@gradio/theme": "^0.2.0",
437
+ "svelte-i18n": "^3.6.0"
438
+ }
439
+ },
440
+ "node_modules/@gradio/client": {
441
+ "version": "0.10.1",
442
+ "resolved": "https://registry.npmjs.org/@gradio/client/-/client-0.10.1.tgz",
443
+ "integrity": "sha512-C3uWIWEqlpTuG3sfPw3K3+26Fkr+jXPL8U2lC1u7DlBm25rHdGMVX17o8ApW7XcFtznfaLceVtpnDPkDpQTJlw==",
444
+ "dependencies": {
445
+ "bufferutil": "^4.0.7",
446
+ "semiver": "^1.1.0",
447
+ "ws": "^8.13.0"
448
+ },
449
+ "engines": {
450
+ "node": ">=18.0.0"
451
+ }
452
+ },
453
+ "node_modules/@gradio/column": {
454
+ "version": "0.1.0",
455
+ "resolved": "https://registry.npmjs.org/@gradio/column/-/column-0.1.0.tgz",
456
+ "integrity": "sha512-P24nqqVnMXBaDA1f/zSN5HZRho4PxP8Dq+7VltPHlmxIEiZYik2AJ4J0LeuIha34FDO0guu/16evdrpvGIUAfw=="
457
+ },
458
+ "node_modules/@gradio/icons": {
459
+ "version": "0.3.3",
460
+ "resolved": "https://registry.npmjs.org/@gradio/icons/-/icons-0.3.3.tgz",
461
+ "integrity": "sha512-UFTHpjzFJVwaRzZsdslWxnKUPGgtVeErmUGzrG9di4Vn0oHn1FgHt1Yr2SVu4lO3JI/r2u3H49tb6iax4U9HjA=="
462
+ },
463
+ "node_modules/@gradio/statustracker": {
464
+ "version": "0.4.4",
465
+ "resolved": "https://registry.npmjs.org/@gradio/statustracker/-/statustracker-0.4.4.tgz",
466
+ "integrity": "sha512-+bqdly30Tnj0YnM8VOAJjFs0i6RxlxRdQYrd0FRAilw0RDejmfO5LFH+vDRnPl0seK/Of37iP+E5CsqVD3dPeg==",
467
+ "dependencies": {
468
+ "@gradio/atoms": "^0.5.0",
469
+ "@gradio/column": "^0.1.0",
470
+ "@gradio/icons": "^0.3.2",
471
+ "@gradio/utils": "^0.2.1"
472
+ }
473
+ },
474
+ "node_modules/@gradio/statustracker/node_modules/@gradio/utils": {
475
+ "version": "0.2.2",
476
+ "resolved": "https://registry.npmjs.org/@gradio/utils/-/utils-0.2.2.tgz",
477
+ "integrity": "sha512-dNDvyS8tq9uIdmF3O/0skXhSijGm8MVnfYppGnxS5B2F2HNCFgtD0s8yweGRnKbqLwOi29zb9N8ff1i/NVR7ew==",
478
+ "dependencies": {
479
+ "@gradio/theme": "^0.2.0",
480
+ "svelte-i18n": "^3.6.0"
481
+ }
482
+ },
483
+ "node_modules/@gradio/theme": {
484
+ "version": "0.2.0",
485
+ "resolved": "https://registry.npmjs.org/@gradio/theme/-/theme-0.2.0.tgz",
486
+ "integrity": "sha512-33c68Nk7oRXLn08OxPfjcPm7S4tXGOUV1I1bVgzdM2YV5o1QBOS1GEnXPZPu/CEYPePLMB6bsDwffrLEyLGWVQ=="
487
+ },
488
+ "node_modules/@gradio/utils": {
489
+ "version": "0.2.1",
490
+ "resolved": "https://registry.npmjs.org/@gradio/utils/-/utils-0.2.1.tgz",
491
+ "integrity": "sha512-7XnnY9R/FiJ55M2Sw+gHjSvTql5VWG3j2sh+Wt1jLnSURQARoAqizgo2Sg1WZU0igXzrrc9WVZdGE45m5qCHeg==",
492
+ "dependencies": {
493
+ "@gradio/theme": "^0.2.0",
494
+ "svelte-i18n": "^3.6.0"
495
+ }
496
+ },
497
+ "node_modules/@jridgewell/gen-mapping": {
498
+ "version": "0.3.4",
499
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.4.tgz",
500
+ "integrity": "sha512-Oud2QPM5dHviZNn4y/WhhYKSXksv+1xLEIsNrAbGcFzUN3ubqWRFT5gwPchNc5NuzILOU4tPBDTZ4VwhL8Y7cw==",
501
+ "peer": true,
502
+ "dependencies": {
503
+ "@jridgewell/set-array": "^1.0.1",
504
+ "@jridgewell/sourcemap-codec": "^1.4.10",
505
+ "@jridgewell/trace-mapping": "^0.3.9"
506
+ },
507
+ "engines": {
508
+ "node": ">=6.0.0"
509
+ }
510
+ },
511
+ "node_modules/@jridgewell/resolve-uri": {
512
+ "version": "3.1.2",
513
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
514
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
515
+ "peer": true,
516
+ "engines": {
517
+ "node": ">=6.0.0"
518
+ }
519
+ },
520
+ "node_modules/@jridgewell/set-array": {
521
+ "version": "1.2.1",
522
+ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz",
523
+ "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",
524
+ "peer": true,
525
+ "engines": {
526
+ "node": ">=6.0.0"
527
+ }
528
+ },
529
+ "node_modules/@jridgewell/sourcemap-codec": {
530
+ "version": "1.4.15",
531
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
532
+ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
533
+ "peer": true
534
+ },
535
+ "node_modules/@jridgewell/trace-mapping": {
536
+ "version": "0.3.23",
537
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.23.tgz",
538
+ "integrity": "sha512-9/4foRoUKp8s96tSkh8DlAAc5A0Ty8vLXld+l9gjKKY6ckwI8G15f0hskGmuLZu78ZlGa1vtsfOa+lnB4vG6Jg==",
539
+ "peer": true,
540
+ "dependencies": {
541
+ "@jridgewell/resolve-uri": "^3.1.0",
542
+ "@jridgewell/sourcemap-codec": "^1.4.14"
543
+ }
544
+ },
545
+ "node_modules/@mkkellogg/gaussian-splats-3d": {
546
+ "version": "0.2.3",
547
+ "resolved": "https://registry.npmjs.org/@mkkellogg/gaussian-splats-3d/-/gaussian-splats-3d-0.2.3.tgz",
548
+ "integrity": "sha512-rl9T9+9YPm29/tG/CrDL/VAD7ZtC4C8BElxUhdTa4xjW+DsBNZW6vCqiZLuFmcNpNyXdpCvT03PcwBVuT38/zg==",
549
+ "peerDependencies": {
550
+ "three": ">=0.160.0"
551
+ }
552
+ },
553
+ "node_modules/@types/estree": {
554
+ "version": "1.0.5",
555
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
556
+ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
557
+ "peer": true
558
+ },
559
+ "node_modules/acorn": {
560
+ "version": "8.11.3",
561
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
562
+ "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
563
+ "peer": true,
564
+ "bin": {
565
+ "acorn": "bin/acorn"
566
+ },
567
+ "engines": {
568
+ "node": ">=0.4.0"
569
+ }
570
+ },
571
+ "node_modules/aria-query": {
572
+ "version": "5.3.0",
573
+ "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
574
+ "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
575
+ "peer": true,
576
+ "dependencies": {
577
+ "dequal": "^2.0.3"
578
+ }
579
+ },
580
+ "node_modules/axobject-query": {
581
+ "version": "4.0.0",
582
+ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz",
583
+ "integrity": "sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==",
584
+ "peer": true,
585
+ "dependencies": {
586
+ "dequal": "^2.0.3"
587
+ }
588
+ },
589
+ "node_modules/bufferutil": {
590
+ "version": "4.0.8",
591
+ "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz",
592
+ "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==",
593
+ "hasInstallScript": true,
594
+ "dependencies": {
595
+ "node-gyp-build": "^4.3.0"
596
+ },
597
+ "engines": {
598
+ "node": ">=6.14.2"
599
+ }
600
+ },
601
+ "node_modules/cli-color": {
602
+ "version": "2.0.4",
603
+ "resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.4.tgz",
604
+ "integrity": "sha512-zlnpg0jNcibNrO7GG9IeHH7maWFeCz+Ja1wx/7tZNU5ASSSSZ+/qZciM0/LHCYxSdqv5h2sdbQ/PXYdOuetXvA==",
605
+ "dependencies": {
606
+ "d": "^1.0.1",
607
+ "es5-ext": "^0.10.64",
608
+ "es6-iterator": "^2.0.3",
609
+ "memoizee": "^0.4.15",
610
+ "timers-ext": "^0.1.7"
611
+ },
612
+ "engines": {
613
+ "node": ">=0.10"
614
+ }
615
+ },
616
+ "node_modules/code-red": {
617
+ "version": "1.0.4",
618
+ "resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz",
619
+ "integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==",
620
+ "peer": true,
621
+ "dependencies": {
622
+ "@jridgewell/sourcemap-codec": "^1.4.15",
623
+ "@types/estree": "^1.0.1",
624
+ "acorn": "^8.10.0",
625
+ "estree-walker": "^3.0.3",
626
+ "periscopic": "^3.1.0"
627
+ }
628
+ },
629
+ "node_modules/css-tree": {
630
+ "version": "2.3.1",
631
+ "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz",
632
+ "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==",
633
+ "peer": true,
634
+ "dependencies": {
635
+ "mdn-data": "2.0.30",
636
+ "source-map-js": "^1.0.1"
637
+ },
638
+ "engines": {
639
+ "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
640
+ }
641
+ },
642
+ "node_modules/d": {
643
+ "version": "1.0.1",
644
+ "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
645
+ "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
646
+ "dependencies": {
647
+ "es5-ext": "^0.10.50",
648
+ "type": "^1.0.1"
649
+ }
650
+ },
651
+ "node_modules/deepmerge": {
652
+ "version": "4.3.1",
653
+ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
654
+ "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
655
+ "engines": {
656
+ "node": ">=0.10.0"
657
+ }
658
+ },
659
+ "node_modules/dequal": {
660
+ "version": "2.0.3",
661
+ "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
662
+ "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
663
+ "peer": true,
664
+ "engines": {
665
+ "node": ">=6"
666
+ }
667
+ },
668
+ "node_modules/es5-ext": {
669
+ "version": "0.10.64",
670
+ "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz",
671
+ "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==",
672
+ "hasInstallScript": true,
673
+ "dependencies": {
674
+ "es6-iterator": "^2.0.3",
675
+ "es6-symbol": "^3.1.3",
676
+ "esniff": "^2.0.1",
677
+ "next-tick": "^1.1.0"
678
+ },
679
+ "engines": {
680
+ "node": ">=0.10"
681
+ }
682
+ },
683
+ "node_modules/es6-iterator": {
684
+ "version": "2.0.3",
685
+ "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
686
+ "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==",
687
+ "dependencies": {
688
+ "d": "1",
689
+ "es5-ext": "^0.10.35",
690
+ "es6-symbol": "^3.1.1"
691
+ }
692
+ },
693
+ "node_modules/es6-symbol": {
694
+ "version": "3.1.3",
695
+ "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
696
+ "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
697
+ "dependencies": {
698
+ "d": "^1.0.1",
699
+ "ext": "^1.1.2"
700
+ }
701
+ },
702
+ "node_modules/es6-weak-map": {
703
+ "version": "2.0.3",
704
+ "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz",
705
+ "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==",
706
+ "dependencies": {
707
+ "d": "1",
708
+ "es5-ext": "^0.10.46",
709
+ "es6-iterator": "^2.0.3",
710
+ "es6-symbol": "^3.1.1"
711
+ }
712
+ },
713
+ "node_modules/esbuild": {
714
+ "version": "0.19.12",
715
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz",
716
+ "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==",
717
+ "hasInstallScript": true,
718
+ "bin": {
719
+ "esbuild": "bin/esbuild"
720
+ },
721
+ "engines": {
722
+ "node": ">=12"
723
+ },
724
+ "optionalDependencies": {
725
+ "@esbuild/aix-ppc64": "0.19.12",
726
+ "@esbuild/android-arm": "0.19.12",
727
+ "@esbuild/android-arm64": "0.19.12",
728
+ "@esbuild/android-x64": "0.19.12",
729
+ "@esbuild/darwin-arm64": "0.19.12",
730
+ "@esbuild/darwin-x64": "0.19.12",
731
+ "@esbuild/freebsd-arm64": "0.19.12",
732
+ "@esbuild/freebsd-x64": "0.19.12",
733
+ "@esbuild/linux-arm": "0.19.12",
734
+ "@esbuild/linux-arm64": "0.19.12",
735
+ "@esbuild/linux-ia32": "0.19.12",
736
+ "@esbuild/linux-loong64": "0.19.12",
737
+ "@esbuild/linux-mips64el": "0.19.12",
738
+ "@esbuild/linux-ppc64": "0.19.12",
739
+ "@esbuild/linux-riscv64": "0.19.12",
740
+ "@esbuild/linux-s390x": "0.19.12",
741
+ "@esbuild/linux-x64": "0.19.12",
742
+ "@esbuild/netbsd-x64": "0.19.12",
743
+ "@esbuild/openbsd-x64": "0.19.12",
744
+ "@esbuild/sunos-x64": "0.19.12",
745
+ "@esbuild/win32-arm64": "0.19.12",
746
+ "@esbuild/win32-ia32": "0.19.12",
747
+ "@esbuild/win32-x64": "0.19.12"
748
+ }
749
+ },
750
+ "node_modules/esniff": {
751
+ "version": "2.0.1",
752
+ "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz",
753
+ "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==",
754
+ "dependencies": {
755
+ "d": "^1.0.1",
756
+ "es5-ext": "^0.10.62",
757
+ "event-emitter": "^0.3.5",
758
+ "type": "^2.7.2"
759
+ },
760
+ "engines": {
761
+ "node": ">=0.10"
762
+ }
763
+ },
764
+ "node_modules/esniff/node_modules/type": {
765
+ "version": "2.7.2",
766
+ "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz",
767
+ "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw=="
768
+ },
769
+ "node_modules/estree-walker": {
770
+ "version": "3.0.3",
771
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
772
+ "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
773
+ "peer": true,
774
+ "dependencies": {
775
+ "@types/estree": "^1.0.0"
776
+ }
777
+ },
778
+ "node_modules/event-emitter": {
779
+ "version": "0.3.5",
780
+ "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
781
+ "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==",
782
+ "dependencies": {
783
+ "d": "1",
784
+ "es5-ext": "~0.10.14"
785
+ }
786
+ },
787
+ "node_modules/ext": {
788
+ "version": "1.7.0",
789
+ "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz",
790
+ "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==",
791
+ "dependencies": {
792
+ "type": "^2.7.2"
793
+ }
794
+ },
795
+ "node_modules/ext/node_modules/type": {
796
+ "version": "2.7.2",
797
+ "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz",
798
+ "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw=="
799
+ },
800
+ "node_modules/globalyzer": {
801
+ "version": "0.1.0",
802
+ "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
803
+ "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q=="
804
+ },
805
+ "node_modules/globrex": {
806
+ "version": "0.1.2",
807
+ "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
808
+ "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg=="
809
+ },
810
+ "node_modules/intl-messageformat": {
811
+ "version": "9.13.0",
812
+ "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-9.13.0.tgz",
813
+ "integrity": "sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==",
814
+ "dependencies": {
815
+ "@formatjs/ecma402-abstract": "1.11.4",
816
+ "@formatjs/fast-memoize": "1.2.1",
817
+ "@formatjs/icu-messageformat-parser": "2.1.0",
818
+ "tslib": "^2.1.0"
819
+ }
820
+ },
821
+ "node_modules/is-promise": {
822
+ "version": "2.2.2",
823
+ "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz",
824
+ "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="
825
+ },
826
+ "node_modules/is-reference": {
827
+ "version": "3.0.2",
828
+ "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz",
829
+ "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==",
830
+ "peer": true,
831
+ "dependencies": {
832
+ "@types/estree": "*"
833
+ }
834
+ },
835
+ "node_modules/locate-character": {
836
+ "version": "3.0.0",
837
+ "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",
838
+ "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==",
839
+ "peer": true
840
+ },
841
+ "node_modules/lru-queue": {
842
+ "version": "0.1.0",
843
+ "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz",
844
+ "integrity": "sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==",
845
+ "dependencies": {
846
+ "es5-ext": "~0.10.2"
847
+ }
848
+ },
849
+ "node_modules/magic-string": {
850
+ "version": "0.30.7",
851
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz",
852
+ "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==",
853
+ "peer": true,
854
+ "dependencies": {
855
+ "@jridgewell/sourcemap-codec": "^1.4.15"
856
+ },
857
+ "engines": {
858
+ "node": ">=12"
859
+ }
860
+ },
861
+ "node_modules/mdn-data": {
862
+ "version": "2.0.30",
863
+ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz",
864
+ "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==",
865
+ "peer": true
866
+ },
867
+ "node_modules/memoizee": {
868
+ "version": "0.4.15",
869
+ "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz",
870
+ "integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==",
871
+ "dependencies": {
872
+ "d": "^1.0.1",
873
+ "es5-ext": "^0.10.53",
874
+ "es6-weak-map": "^2.0.3",
875
+ "event-emitter": "^0.3.5",
876
+ "is-promise": "^2.2.2",
877
+ "lru-queue": "^0.1.0",
878
+ "next-tick": "^1.1.0",
879
+ "timers-ext": "^0.1.7"
880
+ }
881
+ },
882
+ "node_modules/mri": {
883
+ "version": "1.2.0",
884
+ "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
885
+ "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
886
+ "engines": {
887
+ "node": ">=4"
888
+ }
889
+ },
890
+ "node_modules/next-tick": {
891
+ "version": "1.1.0",
892
+ "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
893
+ "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ=="
894
+ },
895
+ "node_modules/node-gyp-build": {
896
+ "version": "4.8.0",
897
+ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.0.tgz",
898
+ "integrity": "sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==",
899
+ "bin": {
900
+ "node-gyp-build": "bin.js",
901
+ "node-gyp-build-optional": "optional.js",
902
+ "node-gyp-build-test": "build-test.js"
903
+ }
904
+ },
905
+ "node_modules/periscopic": {
906
+ "version": "3.1.0",
907
+ "resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz",
908
+ "integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==",
909
+ "peer": true,
910
+ "dependencies": {
911
+ "@types/estree": "^1.0.0",
912
+ "estree-walker": "^3.0.0",
913
+ "is-reference": "^3.0.0"
914
+ }
915
+ },
916
+ "node_modules/sade": {
917
+ "version": "1.8.1",
918
+ "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",
919
+ "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==",
920
+ "dependencies": {
921
+ "mri": "^1.1.0"
922
+ },
923
+ "engines": {
924
+ "node": ">=6"
925
+ }
926
+ },
927
+ "node_modules/semiver": {
928
+ "version": "1.1.0",
929
+ "resolved": "https://registry.npmjs.org/semiver/-/semiver-1.1.0.tgz",
930
+ "integrity": "sha512-QNI2ChmuioGC1/xjyYwyZYADILWyW6AmS1UH6gDj/SFUUUS4MBAWs/7mxnkRPc/F4iHezDP+O8t0dO8WHiEOdg==",
931
+ "engines": {
932
+ "node": ">=6"
933
+ }
934
+ },
935
+ "node_modules/source-map-js": {
936
+ "version": "1.0.2",
937
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
938
+ "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
939
+ "peer": true,
940
+ "engines": {
941
+ "node": ">=0.10.0"
942
+ }
943
+ },
944
+ "node_modules/svelte": {
945
+ "version": "4.2.12",
946
+ "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.12.tgz",
947
+ "integrity": "sha512-d8+wsh5TfPwqVzbm4/HCXC783/KPHV60NvwitJnyTA5lWn1elhXMNWhXGCJ7PwPa8qFUnyJNIyuIRt2mT0WMug==",
948
+ "peer": true,
949
+ "dependencies": {
950
+ "@ampproject/remapping": "^2.2.1",
951
+ "@jridgewell/sourcemap-codec": "^1.4.15",
952
+ "@jridgewell/trace-mapping": "^0.3.18",
953
+ "@types/estree": "^1.0.1",
954
+ "acorn": "^8.9.0",
955
+ "aria-query": "^5.3.0",
956
+ "axobject-query": "^4.0.0",
957
+ "code-red": "^1.0.3",
958
+ "css-tree": "^2.3.1",
959
+ "estree-walker": "^3.0.3",
960
+ "is-reference": "^3.0.1",
961
+ "locate-character": "^3.0.0",
962
+ "magic-string": "^0.30.4",
963
+ "periscopic": "^3.1.0"
964
+ },
965
+ "engines": {
966
+ "node": ">=16"
967
+ }
968
+ },
969
+ "node_modules/svelte-i18n": {
970
+ "version": "3.7.4",
971
+ "resolved": "https://registry.npmjs.org/svelte-i18n/-/svelte-i18n-3.7.4.tgz",
972
+ "integrity": "sha512-yGRCNo+eBT4cPuU7IVsYTYjxB7I2V8qgUZPlHnNctJj5IgbJgV78flsRzpjZ/8iUYZrS49oCt7uxlU3AZv/N5Q==",
973
+ "dependencies": {
974
+ "cli-color": "^2.0.3",
975
+ "deepmerge": "^4.2.2",
976
+ "esbuild": "^0.19.2",
977
+ "estree-walker": "^2",
978
+ "intl-messageformat": "^9.13.0",
979
+ "sade": "^1.8.1",
980
+ "tiny-glob": "^0.2.9"
981
+ },
982
+ "bin": {
983
+ "svelte-i18n": "dist/cli.js"
984
+ },
985
+ "engines": {
986
+ "node": ">= 16"
987
+ },
988
+ "peerDependencies": {
989
+ "svelte": "^3 || ^4"
990
+ }
991
+ },
992
+ "node_modules/svelte-i18n/node_modules/estree-walker": {
993
+ "version": "2.0.2",
994
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
995
+ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
996
+ },
997
+ "node_modules/three": {
998
+ "version": "0.162.0",
999
+ "resolved": "https://registry.npmjs.org/three/-/three-0.162.0.tgz",
1000
+ "integrity": "sha512-xfCYj4RnlozReCmUd+XQzj6/5OjDNHBy5nT6rVwrOKGENAvpXe2z1jL+DZYaMu4/9pNsjH/4Os/VvS9IrH7IOQ=="
1001
+ },
1002
+ "node_modules/timers-ext": {
1003
+ "version": "0.1.7",
1004
+ "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz",
1005
+ "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==",
1006
+ "dependencies": {
1007
+ "es5-ext": "~0.10.46",
1008
+ "next-tick": "1"
1009
+ }
1010
+ },
1011
+ "node_modules/tiny-glob": {
1012
+ "version": "0.2.9",
1013
+ "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
1014
+ "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
1015
+ "dependencies": {
1016
+ "globalyzer": "0.1.0",
1017
+ "globrex": "^0.1.2"
1018
+ }
1019
+ },
1020
+ "node_modules/tslib": {
1021
+ "version": "2.6.2",
1022
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
1023
+ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
1024
+ },
1025
+ "node_modules/type": {
1026
+ "version": "1.2.0",
1027
+ "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
1028
+ "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg=="
1029
+ },
1030
+ "node_modules/ws": {
1031
+ "version": "8.16.0",
1032
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz",
1033
+ "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==",
1034
+ "engines": {
1035
+ "node": ">=10.0.0"
1036
+ },
1037
+ "peerDependencies": {
1038
+ "bufferutil": "^4.0.1",
1039
+ "utf-8-validate": ">=5.0.2"
1040
+ },
1041
+ "peerDependenciesMeta": {
1042
+ "bufferutil": {
1043
+ "optional": true
1044
+ },
1045
+ "utf-8-validate": {
1046
+ "optional": true
1047
+ }
1048
+ }
1049
+ }
1050
+ }
1051
+ }
src/frontend/package.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "gradio_model4dgs",
3
+ "version": "0.0.1",
4
+ "description": "Gradio UI packages",
5
+ "type": "module",
6
+ "author": "",
7
+ "license": "ISC",
8
+ "private": false,
9
+ "main_changeset": true,
10
+ "exports": {
11
+ ".": "./Index.svelte",
12
+ "./example": "./Example.svelte",
13
+ "./package.json": "./package.json"
14
+ },
15
+ "dependencies": {
16
+ "@gradio/atoms": "0.5.0",
17
+ "@gradio/client": "0.10.1",
18
+ "@gradio/statustracker": "0.4.4",
19
+ "@gradio/utils": "0.2.1",
20
+ "@mkkellogg/gaussian-splats-3d": "^0.2.3",
21
+ "three": "^0.162.0"
22
+ }
23
+ }
src/frontend/shared/Model4DGS.svelte ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script lang="ts">
2
+ import { FileData, normalise_file } from "@gradio/client";
3
+ import { BlockLabel } from "@gradio/atoms";
4
+ import { File } from "@gradio/icons";
5
+ import { onMount } from "svelte";
6
+ import * as GaussianSplats3D from "@mkkellogg/gaussian-splats-3d";
7
+ import * as THREE from "three";
8
+ import type { I18nFormatter } from "@gradio/utils";
9
+
10
+ export let value: null | { files: FileData[]; };
11
+ export let root: string;
12
+ export let proxy_url: null | string;
13
+ export let label = "";
14
+ export let show_label: boolean;
15
+ export let i18n: I18nFormatter;
16
+
17
+ let currFrameIndex = 0;
18
+ let NUM_FRAMES = 1;
19
+
20
+ var sceneOptions: Array<object> = []
21
+ const visible_scale = new THREE.Vector3(1.25, 1.25, 1.25);
22
+ const invisible_scale = new THREE.Vector3(0.01, 0.01, 0.01);
23
+
24
+ onMount(() => {
25
+ if (value != null && value.files != null) {
26
+ const viewerContainer = document.querySelector('.model4DGS');
27
+ const viewer = new GaussianSplats3D.Viewer({
28
+ cameraUp: [0, 1, 0],
29
+ initialCameraPosition: [0, 0, 4],
30
+ initialCameraLookAt: [0, 0, -1],
31
+ dynamicScene: true,
32
+ sharedMemoryForWorkers: false,
33
+ rootElement: viewerContainer
34
+ });
35
+
36
+ NUM_FRAMES = value.files.length;
37
+ let files = value.files;
38
+
39
+ for (let i = 0; i < files.length; i++) {
40
+ let opt = {
41
+ path: normalise_file(files[i], root, proxy_url).url,
42
+ scale: [invisible_scale, invisible_scale, invisible_scale]
43
+ };
44
+ sceneOptions.push(opt);
45
+ }
46
+
47
+ viewer
48
+ .addSplatScenes(sceneOptions,true)
49
+ .then(() => {
50
+ viewer.start();
51
+
52
+ let startTime = performance.now();
53
+ requestAnimationFrame(update);
54
+ function update() {
55
+ requestAnimationFrame(update);
56
+ const timeDelta = performance.now() - startTime;
57
+
58
+ if (timeDelta > 150) {
59
+ const prevSplatScene = viewer.getSplatScene(currFrameIndex);
60
+ prevSplatScene.scale.copy(invisible_scale);
61
+
62
+ startTime = performance.now();
63
+ currFrameIndex++;
64
+ if (currFrameIndex >= NUM_FRAMES) currFrameIndex = 0;
65
+
66
+ const curSplatScene = viewer.getSplatScene(currFrameIndex);
67
+ curSplatScene.scale.copy(visible_scale);
68
+ }
69
+ }
70
+ });
71
+ }
72
+ });
73
+ </script>
74
+
75
+ <BlockLabel {show_label} Icon={File} label={label || i18n("4DGS_model.splat")} />
76
+ <div class="model4DGS">
77
+ </div>
78
+
79
+ <style>
80
+ .model4DGS {
81
+ display: flex;
82
+ position: relative;
83
+ width: var(--size-full);
84
+ height: var(--size-full);
85
+ min-height: 250px;
86
+ }
87
+ </style>
88
+
src/pyproject.toml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [build-system]
2
+ requires = [
3
+ "hatchling",
4
+ "hatch-requirements-txt",
5
+ "hatch-fancy-pypi-readme>=22.5.0",
6
+ ]
7
+ build-backend = "hatchling.build"
8
+
9
+ [project]
10
+ name = "gradio_model4dgs"
11
+ version = "0.0.3"
12
+ description = "Python library for easily interacting with trained machine learning models"
13
+ readme = "README.md"
14
+ license = "MIT"
15
+ requires-python = ">=3.8"
16
+ authors = [{ name = "Zhang Chi", email = "[email protected]" }]
17
+ keywords = ["gradio-custom-component", "gradio-template-Fallback"]
18
+ # Add dependencies here
19
+ dependencies = ["gradio>=4.0,<5.0"]
20
+ classifiers = [
21
+ 'Development Status :: 3 - Alpha',
22
+ 'License :: OSI Approved :: Apache Software License',
23
+ 'Operating System :: OS Independent',
24
+ 'Programming Language :: Python :: 3',
25
+ 'Programming Language :: Python :: 3 :: Only',
26
+ 'Programming Language :: Python :: 3.8',
27
+ 'Programming Language :: Python :: 3.9',
28
+ 'Programming Language :: Python :: 3.10',
29
+ 'Programming Language :: Python :: 3.11',
30
+ 'Topic :: Scientific/Engineering',
31
+ 'Topic :: Scientific/Engineering :: Artificial Intelligence',
32
+ 'Topic :: Scientific/Engineering :: Visualization',
33
+ ]
34
+
35
+ [project.optional-dependencies]
36
+ dev = ["build", "twine"]
37
+
38
+ [tool.hatch.build]
39
+ artifacts = ["/backend/gradio_model4dgs/templates", "*.pyi"]
40
+
41
+ [tool.hatch.build.targets.wheel]
42
+ packages = ["/backend/gradio_model4dgs"]
tiger_rgba.png ADDED