ritianyu commited on
Commit
f2e9a22
·
1 Parent(s): 83ad32a

Add viewer source maps via LFS

Browse files
.gitattributes CHANGED
@@ -6,3 +6,4 @@
6
  # checkpoints/depth/*.pt filter=lfs diff=lfs merge=lfs -text
7
  *.webp filter=lfs diff=lfs merge=lfs -text
8
  *.wasm filter=lfs diff=lfs merge=lfs -text
 
 
6
  # checkpoints/depth/*.pt filter=lfs diff=lfs merge=lfs -text
7
  *.webp filter=lfs diff=lfs merge=lfs -text
8
  *.wasm filter=lfs diff=lfs merge=lfs -text
9
+ assets/supersplat-viewer/index.js.map filter=lfs diff=lfs merge=lfs -text
.gitignore CHANGED
@@ -1,4 +1,3 @@
1
  checkpoints
2
  __pycache__/
3
  *.pyc
4
- assets/supersplat-viewer/*.map
 
1
  checkpoints
2
  __pycache__/
3
  *.pyc
 
InfiniDepth/model/block/prompt_models/__pycache__/__init__.cpython-310.pyc CHANGED
Binary files a/InfiniDepth/model/block/prompt_models/__pycache__/__init__.cpython-310.pyc and b/InfiniDepth/model/block/prompt_models/__pycache__/__init__.cpython-310.pyc differ
 
InfiniDepth/model/block/prompt_models/__pycache__/rope.cpython-310.pyc CHANGED
Binary files a/InfiniDepth/model/block/prompt_models/__pycache__/rope.cpython-310.pyc and b/InfiniDepth/model/block/prompt_models/__pycache__/rope.cpython-310.pyc differ
 
InfiniDepth/model/block/prompt_models/__pycache__/sam.cpython-310.pyc CHANGED
Binary files a/InfiniDepth/model/block/prompt_models/__pycache__/sam.cpython-310.pyc and b/InfiniDepth/model/block/prompt_models/__pycache__/sam.cpython-310.pyc differ
 
InfiniDepth/model/block/prompt_models/__pycache__/selfattn.cpython-310.pyc CHANGED
Binary files a/InfiniDepth/model/block/prompt_models/__pycache__/selfattn.cpython-310.pyc and b/InfiniDepth/model/block/prompt_models/__pycache__/selfattn.cpython-310.pyc differ
 
InfiniDepth/model/block/prompt_models/utils/__pycache__/__init__.cpython-310.pyc CHANGED
Binary files a/InfiniDepth/model/block/prompt_models/utils/__pycache__/__init__.cpython-310.pyc and b/InfiniDepth/model/block/prompt_models/utils/__pycache__/__init__.cpython-310.pyc differ
 
InfiniDepth/model/block/prompt_models/utils/__pycache__/pe_utils.cpython-310.pyc CHANGED
Binary files a/InfiniDepth/model/block/prompt_models/utils/__pycache__/pe_utils.cpython-310.pyc and b/InfiniDepth/model/block/prompt_models/utils/__pycache__/pe_utils.cpython-310.pyc differ
 
InfiniDepth/model/block/prompt_models/utils/__pycache__/transformer.cpython-310.pyc CHANGED
Binary files a/InfiniDepth/model/block/prompt_models/utils/__pycache__/transformer.cpython-310.pyc and b/InfiniDepth/model/block/prompt_models/utils/__pycache__/transformer.cpython-310.pyc differ
 
app.py CHANGED
@@ -1,7 +1,6 @@
1
  from __future__ import annotations
2
 
3
  from functools import lru_cache
4
- import inspect
5
  import os
6
  from pathlib import Path
7
  from typing import Optional
@@ -42,20 +41,6 @@ def _ensure_hf_cache_dirs() -> None:
42
 
43
  _ensure_hf_cache_dirs()
44
 
45
-
46
- def _ensure_valid_omp_num_threads() -> None:
47
- value = os.environ.get("OMP_NUM_THREADS", "").strip()
48
- try:
49
- if int(value) > 0:
50
- return
51
- except (TypeError, ValueError):
52
- pass
53
-
54
- os.environ["OMP_NUM_THREADS"] = "1"
55
-
56
-
57
- _ensure_valid_omp_num_threads()
58
-
59
  import cv2
60
  import gradio as gr
61
  import numpy as np
@@ -137,19 +122,6 @@ DEPTH_VIEW_TAB_ID = "pcd-viewer-tab"
137
  GS_VIEW_TAB_ID = "gs-viewer-tab"
138
  gr.set_static_paths(paths=[str(GS_VIEWER_ROOT)])
139
 
140
-
141
- def _supports_component_kwarg(component_init, kwarg: str) -> bool:
142
- try:
143
- return kwarg in inspect.signature(component_init).parameters
144
- except (TypeError, ValueError):
145
- return False
146
-
147
-
148
- TAB_RENDER_KWARGS = {"render_children": True} if _supports_component_kwarg(gr.Tab.__init__, "render_children") else {}
149
- TABS_RENDER_KWARGS = (
150
- {"render_children": True} if _supports_component_kwarg(gr.Tabs.__init__, "render_children") else {}
151
- )
152
-
153
  CSS = """
154
  #top-workspace {
155
  align-items: stretch;
@@ -374,11 +346,8 @@ def _select_example(evt: gr.SelectData):
374
 
375
 
376
  def _primary_view_for_task(task_type: str):
377
- is_gs = task_type == "GS"
378
- return (
379
- gr.update(visible=not is_gs),
380
- gr.update(visible=is_gs),
381
- )
382
 
383
 
384
  def _update_depth_preview(depth_path: Optional[str]) -> tuple[Optional[np.ndarray], str]:
@@ -829,22 +798,20 @@ with gr.Blocks(css=CSS, theme=gr.themes.Soft()) as demo:
829
  with gr.Column(scale=8, min_width=640, elem_id="outputs-column"):
830
  status_output = gr.Markdown()
831
 
832
- with gr.Group(visible=True) as depth_view_panel:
833
- gr.Markdown("### PCD Viewer")
834
- depth_model_3d = gr.Model3D(
835
- label="Point Cloud Viewer",
836
- display_mode="solid",
837
- clear_color=[1.0, 1.0, 1.0, 1.0],
838
- height=700,
839
- elem_id="depth-model3d-viewer",
840
- )
841
-
842
- with gr.Group(visible=False) as gs_view_panel:
843
- gr.Markdown("### GS Viewer")
844
- gs_viewer_html = gr.HTML(elem_id="gs-viewer-html")
845
 
846
- with gr.Tabs(elem_id="secondary-output-tabs", **TABS_RENDER_KWARGS):
847
- with gr.Tab("Depth Analysis", **TAB_RENDER_KWARGS):
848
  depth_comparison = gr.Image(
849
  label="RGB vs Depth",
850
  type="filepath",
@@ -864,7 +831,7 @@ with gr.Blocks(css=CSS, theme=gr.themes.Soft()) as demo:
864
  height=260,
865
  elem_id="depth-preview",
866
  )
867
- with gr.Tab("Downloads", **TAB_RENDER_KWARGS):
868
  with gr.Row():
869
  depth_download_files = gr.File(label="Depth Files", type="filepath")
870
  gs_download_files = gr.File(label="GS Files", type="filepath")
@@ -877,7 +844,7 @@ with gr.Blocks(css=CSS, theme=gr.themes.Soft()) as demo:
877
  task_type.change(
878
  fn=_primary_view_for_task,
879
  inputs=[task_type],
880
- outputs=[depth_view_panel, gs_view_panel],
881
  )
882
 
883
  output_resolution_mode.change(
@@ -906,7 +873,7 @@ with gr.Blocks(css=CSS, theme=gr.themes.Soft()) as demo:
906
  submit_btn.click(
907
  fn=_primary_view_for_task,
908
  inputs=[task_type],
909
- outputs=[depth_view_panel, gs_view_panel],
910
  ).then(
911
  fn=_clear_outputs,
912
  outputs=[
 
1
  from __future__ import annotations
2
 
3
  from functools import lru_cache
 
4
  import os
5
  from pathlib import Path
6
  from typing import Optional
 
41
 
42
  _ensure_hf_cache_dirs()
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  import cv2
45
  import gradio as gr
46
  import numpy as np
 
122
  GS_VIEW_TAB_ID = "gs-viewer-tab"
123
  gr.set_static_paths(paths=[str(GS_VIEWER_ROOT)])
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  CSS = """
126
  #top-workspace {
127
  align-items: stretch;
 
346
 
347
 
348
  def _primary_view_for_task(task_type: str):
349
+ selected_tab = GS_VIEW_TAB_ID if task_type == "GS" else DEPTH_VIEW_TAB_ID
350
+ return gr.update(selected=selected_tab)
 
 
 
351
 
352
 
353
  def _update_depth_preview(depth_path: Optional[str]) -> tuple[Optional[np.ndarray], str]:
 
798
  with gr.Column(scale=8, min_width=640, elem_id="outputs-column"):
799
  status_output = gr.Markdown()
800
 
801
+ with gr.Tabs(selected=DEPTH_VIEW_TAB_ID, elem_id="primary-view-tabs") as primary_view_tabs:
802
+ with gr.Tab("PCD Viewer", id=DEPTH_VIEW_TAB_ID, render_children=True):
803
+ depth_model_3d = gr.Model3D(
804
+ label="Point Cloud Viewer",
805
+ display_mode="solid",
806
+ clear_color=[1.0, 1.0, 1.0, 1.0],
807
+ height=700,
808
+ elem_id="depth-model3d-viewer",
809
+ )
810
+ with gr.Tab("GS Viewer", id=GS_VIEW_TAB_ID, render_children=True):
811
+ gs_viewer_html = gr.HTML(elem_id="gs-viewer-html")
 
 
812
 
813
+ with gr.Tabs(elem_id="secondary-output-tabs"):
814
+ with gr.Tab("Depth Analysis", render_children=True):
815
  depth_comparison = gr.Image(
816
  label="RGB vs Depth",
817
  type="filepath",
 
831
  height=260,
832
  elem_id="depth-preview",
833
  )
834
+ with gr.Tab("Downloads", render_children=True):
835
  with gr.Row():
836
  depth_download_files = gr.File(label="Depth Files", type="filepath")
837
  gs_download_files = gr.File(label="GS Files", type="filepath")
 
844
  task_type.change(
845
  fn=_primary_view_for_task,
846
  inputs=[task_type],
847
+ outputs=[primary_view_tabs],
848
  )
849
 
850
  output_resolution_mode.change(
 
873
  submit_btn.click(
874
  fn=_primary_view_for_task,
875
  inputs=[task_type],
876
+ outputs=[primary_view_tabs],
877
  ).then(
878
  fn=_clear_outputs,
879
  outputs=[
assets/supersplat-viewer/index.js.map ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21a04113048ab6764cad7be101127e9e2626b3202112d1ca3a0e813270786589
3
+ size 10534848
assets/supersplat-viewer/node-ponyfill-C-pVJllX.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"node-ponyfill-C-pVJllX.js","sources":["../node_modules/cross-fetch/dist/node-ponyfill.js"],"sourcesContent":["const nodeFetch = require('node-fetch')\nconst realFetch = nodeFetch.default || nodeFetch\n\nconst fetch = function (url, options) {\n // Support schemaless URIs on the server for parity with the browser.\n // Ex: //github.com/ -> https://github.com/\n if (/^\\/\\//.test(url)) {\n url = 'https:' + url\n }\n return realFetch.call(this, url, options)\n}\n\nfetch.ponyfill = true\n\nmodule.exports = exports = fetch\nexports.fetch = fetch\nexports.Headers = nodeFetch.Headers\nexports.Request = nodeFetch.Request\nexports.Response = nodeFetch.Response\n\n// Needed for TypeScript consumers without esModuleInterop.\nexports.default = fetch\n"],"names":["nodeFetch","require","realFetch","default","fetch","url","options","test","call","this","ponyfill","module","exports","Headers","Request","Response"],"mappings":"AAAA,MAAMA,EAAYC,QAAQ,cACpBC,EAAYF,EAAUG,SAAWH,EAEjCI,EAAQ,SAAUC,EAAKC,GAM3B,MAHI,QAAQC,KAAKF,KACfA,EAAM,SAAWA,GAEZH,EAAUM,KAAKC,KAAMJ,EAAKC,EACnC,EAEAF,EAAMM,UAAW,EAEjBC,OAAOC,QAAUA,QAAUR,EAC3BQ,QAAQR,MAAQA,EAChBQ,QAAQC,QAAUb,EAAUa,QAC5BD,QAAQE,QAAUd,EAAUc,QAC5BF,QAAQG,SAAWf,EAAUe,SAG7BH,QAAQT,QAAUC","x_google_ignoreList":[0]}
assets/supersplat-viewer/sw.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"sw.js","sources":["../src/sw.ts"],"sourcesContent":["import { version as appVersion } from '../package.json';\n\n// export default null\ndeclare let self: ServiceWorkerGlobalScope;\n\nconst cacheName = `superSplat-v${appVersion}`;\n\nconst cacheUrls = [\n './',\n './index.css',\n './index.html',\n './index.js',\n './index.js.map',\n './manifest.json',\n './static/icons/logo-192.png',\n './static/icons/logo-512.png',\n './static/images/screenshot-narrow.jpg',\n './static/images/screenshot-wide.jpg',\n './static/lib/lodepng/lodepng.js',\n './static/lib/lodepng/lodepng.wasm',\n './static/lib/webp/webp.mjs',\n './static/lib/webp/webp.wasm',\n './static/locales/de.json',\n './static/locales/en.json',\n './static/locales/fr.json',\n './static/locales/ja.json',\n './static/locales/ko.json',\n './static/locales/zh-CN.json'\n];\n\nself.addEventListener('install', (event) => {\n console.log(`installing v${appVersion}`);\n\n // create cache for current version\n event.waitUntil(\n caches.open(cacheName)\n .then((cache) => {\n cache.addAll(cacheUrls);\n })\n );\n});\n\nself.addEventListener('activate', () => {\n console.log(`activating v${appVersion}`);\n\n // delete the old caches once this one is activated\n caches.keys().then((names) => {\n for (const name of names) {\n if (name !== cacheName) {\n caches.delete(name);\n }\n }\n });\n});\n\nself.addEventListener('fetch', (event) => {\n event.respondWith(\n caches.match(event.request)\n .then(response => response ?? fetch(event.request))\n );\n});\n"],"names":["appVersion"],"mappings":";;AAKA,MAAM,SAAS,GAAG,CAAA,YAAA,EAAeA,OAAU,EAAE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