Spaces:
Sleeping
Sleeping
Add standard 3DGS mode (flashimgs3d + Faster-GS rasterizer) next to the 2D fitter
Browse filesFiles changed (6)
11 unmodified lines12131415161718192021222311 unmodified linesThis Space vendors prebuilt wheels of the FlashImgs library under wheels/:flashimgs (built from https://github.com/OpsiClear/flashimgs,commit 11d4d3b plus local working-tree changes)simple_sum_backend (CUDA rasterizer backend)fussim (fused-SSIM CUDA extension, OpsiClear fork)The CUDA-extension wheels (fussim, simple_sum_backend) are compiled for CPython3.12, torch 2.11.0+cu130 (CUDA 13.0), and NVIDIA Blackwell sm_120.FlashImgs and simple_sum_backend are distributed under the OpsiClear RestrictiveLicense — non-commercial use only, no derivatives, and no redistribution. The11 unmodified lines12131415161718192021222324252627282930313211 unmodified linesThis Space vendors prebuilt wheels of the FlashImgs library under wheels/:flashimgs (built from https://github.com/OpsiClear/flashimgs,branch 3dgs-planar, commit 5aac198)simple_sum_backend (CUDA rasterizer backend)fussim (fused-SSIM CUDA extension, OpsiClear fork)FasterGSCudaBackend (Faster-GS 3DGS rasterizer, nerficg-project, Apache-2.0)The CUDA-extension wheels (fussim, simple_sum_backend, FasterGSCudaBackend) arecompiled for CPython 3.12, torch 2.11.0+cu130 (CUDA 13.0), and NVIDIA Blackwellsm_120.FasterGSCudaBackend is built from https://github.com/nerficg-project/faster-gaussian-splatting(commit 3cb0b75; Florian Hahlbohm, Linus Franke, Martin Eisemann, Marcus Magnor,"Faster-GS: Analyzing and Improving Gaussian Splatting Optimization", CVPR 2026),licensed under the Apache License 2.0, with one source-compatibility patch forCUDA 13 / CCCL 3 (cub::Max replaced by a max lambda). The PlayCanvas engine usedby the embedded orbit viewer is loaded from a CDN under the MIT license.FlashImgs and simple_sum_backend are distributed under the OpsiClear RestrictiveLicense — non-commercial use only, no derivatives, and no redistribution. The
8 unmodified lines910111213141516171819202122232425262728293031323310 unmodified lines4445464748495051525354553 unmodified lines5960616263646566674 unmodified lines7273747576777879803 unmodified lines848586878889909192937 unmodified lines1011021031048 unmodified linesapp_file: app.pysuggested_hardware: zero-a10gfullWidth: truepinned: falselicense: agpl-3.0short_description: Adaptive 2D Gaussian splat fitting for images (ZeroGPU).tags:- gaussian-splatting- 2d-gaussian-splatting- image-representation- gradio- zerogpu- computer-vision---# FlashImgs — 2D Gaussian Splatting for ImagesFit any image as a set of **2D Gaussians** in seconds, preview thereconstruction and a 3D Gaussian-splat point cloud, and export files forstandard splat viewers. This Space is a [Gradio](https://www.gradio.app/)wrapper around the [FlashImgs](https://github.com/OpsiClear/flashimgs) adaptivefitter, running on **[ZeroGPU](https://huggingface.co/docs/hub/spaces-zerogpu)**.It does **not** use the gaussifier feedforward sampler, AOTI, or TensorRT path.## Hardware (ZeroGPU)10 unmodified lines## How to use1. Upload an image (PNG/WebP alpha is honored automatically as a fit mask).2. Adjust the **Fit** settings (max side, gaussian budget, steps, loss) if needed.3. Click **Fit**.4. Inspect the **3DGS** point-cloud preview and the **Image** reconstruction.5. Tweak the **PLY** export controls (opacity, scale, thickness, Y axis) — the3D preview updates live — then download the files.### Masks3 unmodified lines## Outputs- Reconstruction preview plus PSNR / SSIM and timing metrics.- `.splat2d` file compatible with the FlashImgs web viewer.- Edited planar **3DGS `.ply`** for standard splat viewers. The `factor_rgb`opacity scale, mask-edge scale clamp, thickness, and Y-axis controls updatethe preview while you adjust them; the downloadable PLY is always the latestedited file.4 unmodified linesbuild-time CUDA toolchain, so FlashImgs and its CUDA backends cannot be compiledon the Space. Instead, prebuilt wheels are vendored under [`wheels/`](wheels):- `flashimgs` (pure Python, built from commit `11d4d3b` + local working-tree changes)- `fussim` and `simple_sum_backend` — CUDA extensions compiled for**CPython 3.12**, **torch 2.11.0+cu130 (CUDA 13.0)**, and **Blackwell `sm_120`**ZeroGPU pre-installs **torch 2.11.0 for CUDA 13.0**, so the wheels are built forcu130 and `requirements.txt` pins bare `torch==2.11.0` / `torchvision==0.26.0`3 unmodified linesbecause FlashImgs resolves its default config relative to the working directory.To rebuild the wheels for a new FlashImgs revision (or a different torch / CUDAarch), build `fussim` and `simple_sum_backend` from the FlashImgs source with`TORCH_CUDA_ARCH_LIST=12.0+PTX` and `CUDA_HOME` pointing at the matching toolkit,against the target torch, and rebuild the `flashimgs` wheel with full packagediscovery.## License7 unmodified linesOpsiClear `fussim` fork) are a separate work under the **OpsiClear RestrictiveLicense** (non-commercial use only). The AGPL-3.0 license of this wrapper doesnot extend to the FlashImgs engine; running the deployed app is subject to theFlashImgs terms.8 unmodified lines910111213141516171819202122232425262728293031323334353637383940414243444510 unmodified lines56575859606162636465666768697071727374757677787980818283843 unmodified lines8889909192939495969798991001011024 unmodified lines1071081091101111121131141151161171181193 unmodified lines1231241251261271281291301311321337 unmodified lines1411421431441451468 unmodified linesapp_file: app.pysuggested_hardware: zero-a10gfullWidth: truepinned: truelicense: agpl-3.0short_description: Image to 2D splats or standard 3DGS on ZeroGPU.tags:- gaussian-splatting- 2d-gaussian-splatting- 3d-gaussian-splatting- image-representation- gradio- zerogpu- computer-vision---# FlashImgs — 2D Gaussian Splatting and standard 3DGS for ImagesTwo ways to turn one image into Gaussians, both running on**[ZeroGPU](https://huggingface.co/docs/hub/spaces-zerogpu)** through a[Gradio](https://www.gradio.app/) wrapper around[FlashImgs](https://github.com/OpsiClear/flashimgs):- **2D splats** (the original fitter): a set of additive 2D Gaussians fittedin seconds, exported as `.splat2d` for the FlashImgs web viewer plus aplanar PLY conversion for splat viewers.- **3DGS** (the `3dgs-planar` branch): the image becomes a thin slab of*standard* 3D Gaussians (3D mean, 3 scales, quaternion, opacity, SH degree0) trained on random perspective views with the[Faster-GS](https://github.com/nerficg-project/faster-gaussian-splatting)rasterizer, and exported as a plain 3DGS `.ply` that any splat viewer loadsand that stays correct from oblique angles. The Space previews it withGradio's Gaussian-splat renderer and in an embedded PlayCanvas orbit viewer.It does **not** use the gaussifier feedforward sampler, AOTI, or TensorRT path.## Hardware (ZeroGPU)10 unmodified lines## How to useThe app has two top-level tabs.**3DGS (standard rasterizer)**1. Upload an image.2. Optionally adjust the budget scale (Gaussians per auto estimate; the thindefault slab wants ~2x), slab thickness in pixels, training tilt range,frontal-view probability and steps.3. Click **Fit 3DGS**. **Splat render** shows Gradio's Gaussian-splat render ofthe exported PLY, **Orbit (PlayCanvas)** an embedded viewer (drag to turn,wheel to zoom, double-click for the frontal view), and **Views** the frontalrender next to a 30-degree tilt against its warped ground truth. Downloadthe `.ply` and `cameras.json` (the first camera is the exact frontal pose)from **Details and downloads**.**2D splats** (the original fitter, unchanged)1. Upload an image (PNG/WebP alpha is honored automatically as a fit mask).2. Adjust the **Fit** settings (max side, gaussian budget, steps, loss) if needed.3. Click **Fit**.4. Inspect the **Image** reconstruction and the **Planar PLY** point cloud.5. Tweak the **PLY** export controls (opacity, scale, thickness, Y axis) — thepreview updates live — then download the files.### Masks3 unmodified lines## Outputs- 3DGS: a standard **3DGS `.ply`** (62 float fields, SH degree 0) in aselectable coordinate system — `opencv` (standard 3DGS/COLMAP: +Y down,frontal camera on -Z; splat viewers expect it), `opengl` (+Y up: three.js,PlayCanvas, glTF), `blender` (+Z up), `unity` or `unreal` (left-handed) —with its `cameras.json` (first entry = the exact frontal pose, in the sameframe), frontal / tilted renders, frontal and tilted-view PSNR, SSIM and timing.- 2D: reconstruction preview plus PSNR / SSIM and timing metrics.- `.splat2d` file compatible with the FlashImgs web viewer.- Edited planar **3DGS `.ply`** converted from the 2D fit. The `factor_rgb`opacity scale, mask-edge scale clamp, thickness, and Y-axis controls updatethe preview while you adjust them; the downloadable PLY is always the latestedited file.4 unmodified linesbuild-time CUDA toolchain, so FlashImgs and its CUDA backends cannot be compiledon the Space. Instead, prebuilt wheels are vendored under [`wheels/`](wheels):- `flashimgs` (pure Python, built from the `3dgs-planar` branch; includes the`flashimgs3d` package and its PlayCanvas viewer page)- `fussim`, `simple_sum_backend` and `FasterGSCudaBackend` (the Faster-GSrasterizer, Apache-2.0, with a one-line CUDA 13 / CCCL 3 compatibility patchapplied by the FlashImgs repo's `tools/install_fastergs.py`) — CUDA extensionscompiled for **CPython 3.12**, **torch 2.11.0+cu130 (CUDA 13.0)**, and**Blackwell `sm_120`**ZeroGPU pre-installs **torch 2.11.0 for CUDA 13.0**, so the wheels are built forcu130 and `requirements.txt` pins bare `torch==2.11.0` / `torchvision==0.26.0`3 unmodified linesbecause FlashImgs resolves its default config relative to the working directory.To rebuild the wheels for a new FlashImgs revision (or a different torch / CUDAarch), build `fussim`, `simple_sum_backend` and the staged Faster-GS backend(`python tools/install_fastergs.py --no-install`, then `build/fastergs/FasterGSCudaBackend`)from the FlashImgs source with `TORCH_CUDA_ARCH_LIST=12.0+PTX` and `CUDA_HOME`pointing at the matching toolkit, against the target torch (`python -m build--wheel --no-isolation`), and rebuild the `flashimgs` wheel the same way.## License7 unmodified linesOpsiClear `fussim` fork) are a separate work under the **OpsiClear RestrictiveLicense** (non-commercial use only). The AGPL-3.0 license of this wrapper doesnot extend to the FlashImgs engine; running the deployed app is subject to theFlashImgs terms. The `FasterGSCudaBackend` wheel is built from[Faster-GS](https://github.com/nerficg-project/faster-gaussian-splatting)(Hahlbohm et al., CVPR 2026), **Apache License 2.0**; see NOTICE.
45 unmodified lines4647484950515215 unmodified lines68697071727374487 unmodified lines5625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196202 unmodified lines62362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070145 unmodified linesOUTPUT_ROOT.mkdir(parents=True, exist_ok=True)APP_CSS = """#workspace {max-width: 1440px;margin: 0 auto;gap: 16px;15 unmodified linesgap: 12px;}@media (max-width: 920px) {#workspace {display: block;}.settings-panel, .results-panel {487 unmodified linestorch.cuda.empty_cache()with gr.Blocks(title="FlashImgs") as demo:gr.Markdown("# FlashImgs")splat_state = gr.State(value=None)ply_state = gr.State(value=None)mask_state = gr.State(value=None)with gr.Row(elem_id="workspace"):with gr.Column(scale=1, min_width=300, elem_classes=["settings-panel"]):image = gr.Image(label="Image",type="pil",sources=["upload", "clipboard"],image_mode="RGBA",height=240,)run = gr.Button("Fit", variant="primary")with gr.Accordion("Fit", open=True):max_side = gr.Slider(0, 4096, value=1536, step=64, label="Max side (0 = original)")gaussians = gr.Slider(0, 100000, value=0, step=1000, label="Gaussians")steps = gr.Slider(100, 3200, value=900, step=100, label="Steps")loss = gr.Dropdown(["l2", "l1", "l2+ssim", "l1+ssim"], value="l2", label="Loss")mask_border_padding = gr.Checkbox(value=True, label="Treat image border as mask border")mask_edge_clamp = gr.Slider(0.0, 1.0, value=0.35, step=0.05, label="Mask edge scale clamp")with gr.Accordion("PLY", open=True):ply_opacity_scale = gr.Slider(0.1, 4.0, value=1.0, step=0.1, label="Opacity scale")ply_min_opacity = gr.Slider(0.001, 0.25, value=0.01, step=0.001, label="Min opacity")ply_max_opacity = gr.Slider(0.05, 0.99, value=0.95, step=0.01, label="Max opacity")ply_scale_multiplier = gr.Slider(0.25, 3.0, value=1.0, step=0.05, label="XY scale multiplier")ply_thickness = gr.Slider(0.00001, 0.002, value=0.0001, step=0.00001, label="Z thickness")ply_y_axis = gr.Dropdown(["down", "up"], value="down", label="PLY Y axis")update_ply = gr.Button("Update PLY Preview")with gr.Accordion("Advanced", open=False):lr = gr.Slider(1.0, 16.0, value=11.0, step=0.5, label="LR")scale = gr.Slider(0.5, 4.0, value=1.5, step=0.1, label="Scale")render_height = gr.Slider(0, 2048, value=0, step=128, label="Render height")seed = gr.Number(value=42, precision=0, label="Seed")with gr.Column(scale=3, min_width=520, elem_classes=["results-panel"]):with gr.Tabs(elem_classes=["preview-tabs"]):with gr.Tab("3DGS"):ply_preview = gr.Model3D(label="3DGS Preview",display_mode="point_cloud",clear_color=(0.03, 0.03, 0.03, 1.0),height=620,)with gr.Tab("Image"):reconstruction = gr.Image(label="Reconstruction", type="pil", height=620)with gr.Accordion("Details and downloads", open=False):metrics = gr.Textbox(label="Metrics", lines=9)with gr.Row(elem_classes=["download-row"]):splat = gr.File(label="Splat2D")ply = gr.File(label="Edited 3DGS PLY")gr.Markdown("FlashImgs Space · © 2025 OpsiClear · wrapper licensed ""[AGPL-3.0](https://www.gnu.org/licenses/agpl-3.0.html) — source available "2 unmodified lineselem_id="app-footer",)run.click(fn=fit_image,inputs=[image,max_side,gaussians,steps,lr,scale,loss,render_height,seed,mask_border_padding,mask_edge_clamp,ply_opacity_scale,ply_min_opacity,ply_max_opacity,ply_scale_multiplier,ply_thickness,ply_y_axis,],outputs=[reconstruction, metrics, splat, ply, ply_preview, splat_state, ply_state, mask_state],show_progress_on=[ply_preview],)ply_update_inputs = [splat_state,ply_state,mask_state,mask_edge_clamp,ply_opacity_scale,ply_min_opacity,ply_max_opacity,ply_scale_multiplier,ply_thickness,ply_y_axis,]ply_update_outputs = [ply, ply_preview, ply_state]update_ply.click(fn=update_ply_preview,inputs=ply_update_inputs,outputs=ply_update_outputs,show_progress="minimal",show_progress_on=[ply_preview],trigger_mode="always_last",concurrency_limit=1,concurrency_id="ply_update",)for control in [mask_edge_clamp, ply_opacity_scale, ply_min_opacity, ply_max_opacity, ply_scale_multiplier, ply_thickness]:control.input(fn=update_ply_preview,inputs=ply_update_inputs,outputs=ply_update_outputs,show_progress="hidden",trigger_mode="always_last",concurrency_limit=1,concurrency_id="ply_update",)for control in [ply_y_axis]:control.change(fn=update_ply_preview,inputs=ply_update_inputs,outputs=ply_update_outputs,show_progress="hidden",trigger_mode="always_last",concurrency_limit=1,concurrency_id="ply_update",)if __name__ == "__main__":demo.queue(default_concurrency_limit=1, max_size=8).launch(server_name="0.0.0.0",server_port=int(os.environ.get("PORT", "7860")),css=APP_CSS,)45 unmodified lines4647484950515215 unmodified lines68697071727374487 unmodified lines5625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039042 unmodified lines90790890991091191291391491591645 unmodified linesOUTPUT_ROOT.mkdir(parents=True, exist_ok=True)APP_CSS = """#workspace, #workspace3d {max-width: 1440px;margin: 0 auto;gap: 16px;15 unmodified linesgap: 12px;}@media (max-width: 920px) {#workspace, #workspace3d {display: block;}.settings-panel, .results-panel {487 unmodified linestorch.cuda.empty_cache()# --------------------------------------------------------------------------- 3DGS (standard rasterizer)def _fit3d_duration(*args, **kwargs) -> float:"""ZeroGPU seconds to reserve for a 3DGS fit: ``(image, max_side, budget_scale, gaussians, steps, ...)``."""def _arg(idx: int, default: float) -> float:try:return float(args[idx])except (IndexError, TypeError, ValueError):return defaultmax_side = _arg(1, 1536.0)budget_scale = _arg(2, 2.0)gaussians = _arg(3, 0.0)steps = _arg(4, 3000.0)est = 35.0 + 0.012 * steps * max(1.0, budget_scale / 2.0) + (gaussians / 100000.0) * 20.0if max_side == 0.0 or max_side > 2048.0:est += 40.0return float(min(240.0, max(60.0, est)))def _viewer_iframe(ply_path: Path) -> str:"""The packaged PlayCanvas viewer, pointed at Gradio's file route for this run's PLY."""try:from flashimgs3d.webview import viewer_pageexcept Exception:return ""src = f"/gradio_api/file={ply_path}"page = viewer_page(src).decode("utf-8")return ('<iframe style="width:100%;height:620px;border:0;border-radius:8px;background:#121212" ''srcdoc="' + page.replace("&", "&").replace('"', """) + '"></iframe>')@spaces.GPU(duration=_fit3d_duration)def fit_image_3d(image: Image.Image,max_side: int,budget_scale: float,gaussians: int,steps: int,thickness_px: float,tilt_max: float,frontal_prob: float,loss: str,paired: bool,solid: float,frame: str,seed: int,progress: gr.Progress = gr.Progress(track_tqdm=False),):"""Fit the image as a standard 3D Gaussian Splatting scene (flashimgs3d + Faster-GS)."""if not torch.cuda.is_available():raise gr.Error("3DGS fitting needs CUDA. In Space settings, select a GPU hardware tier.")try:from flashimgs3d import TrainConfig, Trainer, auto_gaussiansfrom flashimgs3d.camera import orbit_camerafrom flashimgs3d.warp import plane_warpexcept ImportError as exc: # pragma: no cover - wheel not installedraise gr.Error(f"flashimgs3d / Faster-GS backend unavailable: {exc}") from excprogress(0.02, desc="Preparing image")image_tensor, resized_image, _mask, size_note = _prepare_image(image, max_side)fit_w, fit_h = resized_image.sizerun_dir = OUTPUT_ROOT / uuid.uuid4().hexrun_dir.mkdir(parents=True, exist_ok=True)input_path = run_dir / "input.png"resized_image.save(input_path) # the complexity-aware budget reads the filecfg = TrainConfig(steps=max(1, int(steps)),thickness_px=float(thickness_px),budget_scale=float(budget_scale),tilt_max_deg=float(tilt_max),frontal_prob=float(frontal_prob),loss=str(loss),paired_frontal=bool(paired),opacity_solid_weight=float(solid),seed=int(seed),eval_every=0,device="cuda",)n = int(gaussians) if int(gaussians) > 0 else auto_gaussians(fit_h, fit_w, str(input_path), cfg.budget_scale)total_steps = cfg.stepslast = [0]every = max(1, total_steps // 100)def on_step(step: int) -> bool:if step >= total_steps or step - last[0] >= every:last[0] = stepprogress(0.08 + 0.80 * step / total_steps, desc=f"Fitting 3DGS: {step:,}/{total_steps:,} steps")return Truetrainer = Nonestart = time.time()try:progress(0.06, desc=f"Initializing {n:,} Gaussians")trainer = Trainer(image_tensor, cfg, n_gaussians=n, device="cuda", verbose=False)result = trainer.fit(on_step=on_step)m = result.metricsprogress(0.9, desc="Exporting")frame = str(frame or "opencv")ply_path = run_dir / "flashimgs_3dgs.ply"n_written = trainer.export_ply(str(ply_path), frame=frame)cams_path = run_dir / "flashimgs_3dgs.cameras.json"trainer.export_cameras(str(cams_path), frame=frame)progress(0.95, desc="Rendering previews")frontal = _tensor_to_pil(trainer.render())cam = orbit_camera(trainer.canon, tilt_deg=30.0, azimuth_deg=30.0)tilted = _tensor_to_pil(trainer.render(cam))target, _cov = plane_warp(trainer.gt, cam, trainer.black, supersample=4, mode="bicubic")tilted_gt = _tensor_to_pil(target)slab = trainer.cfg.resolved(fit_h)total_s = time.time() - startmetrics = "\n".join([f"Device: {_device_name()}",f"Input: {size_note}",f"Fit resolution: {fit_w}x{fit_h}",f"Gaussians: {n:,} (exported {n_written:,})",f"Slab: {slab.thickness_px:.3g} px ({slab.thickness:.4g} world units, image height = 1)",f"Steps: {total_steps:,} | tilt <= {cfg.tilt_max_deg:.0f} deg | frontal p = {cfg.frontal_prob:g}",f"Frontal PSNR: {m['psnr']:.2f} dB | SSIM: {m['ssim']:.5f}",f"Tilted-view PSNR: {m['views_psnr_inside']:.2f} dB ({m['views']} views, bicubic targets)",f"Training time: {result.elapsed_s:.2f} s",f"Total request time: {total_s:.2f} s",f"Coordinate system: {frame} | 62 float fields, SH degree 0",])_prune_old_outputs()progress(1.0, desc="Done")return (str(ply_path),frontal,tilted_gt,tilted,metrics,str(ply_path),str(cams_path),_viewer_iframe(ply_path),)finally:del trainergc.collect()if torch.cuda.is_available():torch.cuda.empty_cache()with gr.Blocks(title="FlashImgs") as demo:gr.Markdown("# FlashImgs")with gr.Tabs():with gr.Tab("3DGS (standard rasterizer)"):gr.Markdown("Standard **3D Gaussian Splatting**: the image becomes a thin slab of stock 3DGS Gaussians ""(3D mean, 3 scales, quaternion, opacity, SH degree 0) trained on random perspective views with the ""Faster-GS rasterizer, and exported as a plain `.ply` that any splat viewer loads and that stays ""correct from oblique angles.")with gr.Row(elem_id="workspace3d"):with gr.Column(scale=1, min_width=300, elem_classes=["settings-panel"]):image3d = gr.Image(label="Image", type="pil", sources=["upload", "clipboard"], image_mode="RGB", height=240)run3d = gr.Button("Fit 3DGS", variant="primary")with gr.Accordion("Fit", open=True):max_side3d = gr.Slider(0, 4096, value=1536, step=64, label="Max side (0 = original)")budget_scale3d = gr.Slider(0.5, 4.0, value=2.0, step=0.25, label="Budget scale (x auto count)")gaussians3d = gr.Slider(0, 400000, value=0, step=5000, label="Gaussians (0 = auto x budget scale)")steps3d = gr.Slider(300, 6000, value=3000, step=100, label="Steps")thickness3d = gr.Slider(1.0, 60.0, value=5.0, step=1.0, label="Slab thickness (px)")with gr.Accordion("Perspective supervision", open=True):tilt3d = gr.Slider(0.0, 70.0, value=45.0, step=5.0, label="Max training tilt (deg)")frontal_prob3d = gr.Slider(0.0, 1.0, value=0.3, step=0.05, label="Frontal view probability")paired3d = gr.Checkbox(value=False, label="Frontal + random view every step (+0.1-0.6 dB, 1.5x time)")with gr.Accordion("Export", open=True):frame3d = gr.Dropdown(["opencv", "opengl", "blender", "unity", "unreal"],value="opencv",label="Output coordinate system",info="opencv = standard 3DGS/COLMAP (+Y down, camera on -Z; splat viewers, including this preview, ""expect it). opengl = +Y up (three.js, PlayCanvas, glTF). blender = +Z up. unity / unreal = ""left-handed engines.",)with gr.Accordion("Advanced", open=False):loss3d = gr.Dropdown(["3dgs", "l1", "l2", "l1+ssim", "l2+ssim"], value="3dgs", label="Loss")solid3d = gr.Slider(0.0, 0.2, value=0.0, step=0.01, label="Solid-opacity prior")seed3d = gr.Number(value=123, precision=0, label="Seed")with gr.Column(scale=3, min_width=520, elem_classes=["results-panel"]):with gr.Tabs(elem_classes=["preview-tabs"]):with gr.Tab("Splat render"):ply3d_preview = gr.Model3D(label="3DGS preview", clear_color=(0.03, 0.03, 0.03, 1.0), height=620)with gr.Tab("Orbit (PlayCanvas)"):viewer3d = gr.HTML(value='<div style="height:620px;display:flex;align-items:center;justify-content:center;color:#888">'"Fit 3DGS to open the orbit viewer (drag to turn, wheel to zoom, double-click for the frontal view).</div>")with gr.Tab("Views"):frontal_img3d = gr.Image(label="Frontal render", type="pil", height=300)with gr.Row():tilted_gt3d = gr.Image(label="Ground truth warped to a 30 deg tilt", type="pil", height=300)tilted3d = gr.Image(label="Render at the same 30 deg tilt", type="pil", height=300)with gr.Accordion("Details and downloads", open=False):metrics3d = gr.Textbox(label="Metrics", lines=11)with gr.Row(elem_classes=["download-row"]):ply3d = gr.File(label="3DGS PLY")cams3d = gr.File(label="cameras.json")run3d.click(fn=fit_image_3d,inputs=[image3d, max_side3d, budget_scale3d, gaussians3d, steps3d, thickness3d, tilt3d, frontal_prob3d, loss3d, paired3d, solid3d, frame3d, seed3d],outputs=[ply3d_preview, frontal_img3d, tilted_gt3d, tilted3d, metrics3d, ply3d, cams3d, viewer3d],show_progress_on=[ply3d_preview],)with gr.Tab("2D splats"):splat_state = gr.State(value=None)ply_state = gr.State(value=None)mask_state = gr.State(value=None)with gr.Row(elem_id="workspace"):with gr.Column(scale=1, min_width=300, elem_classes=["settings-panel"]):image = gr.Image(label="Image",type="pil",sources=["upload", "clipboard"],image_mode="RGBA",height=240,)run = gr.Button("Fit", variant="primary")with gr.Accordion("Fit", open=True):max_side = gr.Slider(0, 4096, value=1536, step=64, label="Max side (0 = original)")gaussians = gr.Slider(0, 100000, value=0, step=1000, label="Gaussians")steps = gr.Slider(100, 3200, value=900, step=100, label="Steps")loss = gr.Dropdown(["l2", "l1", "l2+ssim", "l1+ssim"], value="l2", label="Loss")mask_border_padding = gr.Checkbox(value=True, label="Treat image border as mask border")mask_edge_clamp = gr.Slider(0.0, 1.0, value=0.35, step=0.05, label="Mask edge scale clamp")with gr.Accordion("PLY", open=True):ply_opacity_scale = gr.Slider(0.1, 4.0, value=1.0, step=0.1, label="Opacity scale")ply_min_opacity = gr.Slider(0.001, 0.25, value=0.01, step=0.001, label="Min opacity")ply_max_opacity = gr.Slider(0.05, 0.99, value=0.95, step=0.01, label="Max opacity")ply_scale_multiplier = gr.Slider(0.25, 3.0, value=1.0, step=0.05, label="XY scale multiplier")ply_thickness = gr.Slider(0.00001, 0.002, value=0.0001, step=0.00001, label="Z thickness")ply_y_axis = gr.Dropdown(["down", "up"], value="down", label="PLY Y axis")update_ply = gr.Button("Update PLY Preview")with gr.Accordion("Advanced", open=False):lr = gr.Slider(1.0, 16.0, value=11.0, step=0.5, label="LR")scale = gr.Slider(0.5, 4.0, value=1.5, step=0.1, label="Scale")render_height = gr.Slider(0, 2048, value=0, step=128, label="Render height")seed = gr.Number(value=42, precision=0, label="Seed")with gr.Column(scale=3, min_width=520, elem_classes=["results-panel"]):with gr.Tabs(elem_classes=["preview-tabs"]):with gr.Tab("Planar PLY (point cloud)"):ply_preview = gr.Model3D(label="Planar PLY preview",display_mode="point_cloud",clear_color=(0.03, 0.03, 0.03, 1.0),height=620,)with gr.Tab("Image"):reconstruction = gr.Image(label="Reconstruction", type="pil", height=620)with gr.Accordion("Details and downloads", open=False):metrics = gr.Textbox(label="Metrics", lines=9)with gr.Row(elem_classes=["download-row"]):splat = gr.File(label="Splat2D")ply = gr.File(label="Edited 3DGS PLY")run.click(fn=fit_image,inputs=[image,max_side,gaussians,steps,lr,scale,loss,render_height,seed,mask_border_padding,mask_edge_clamp,ply_opacity_scale,ply_min_opacity,ply_max_opacity,ply_scale_multiplier,ply_thickness,ply_y_axis,],outputs=[reconstruction, metrics, splat, ply, ply_preview, splat_state, ply_state, mask_state],show_progress_on=[ply_preview],)ply_update_inputs = [splat_state,ply_state,mask_state,mask_edge_clamp,ply_opacity_scale,ply_min_opacity,ply_max_opacity,ply_scale_multiplier,ply_thickness,ply_y_axis,]ply_update_outputs = [ply, ply_preview, ply_state]update_ply.click(fn=update_ply_preview,inputs=ply_update_inputs,outputs=ply_update_outputs,show_progress="minimal",show_progress_on=[ply_preview],trigger_mode="always_last",concurrency_limit=1,concurrency_id="ply_update",)for control in [mask_edge_clamp, ply_opacity_scale, ply_min_opacity, ply_max_opacity, ply_scale_multiplier, ply_thickness]:control.input(fn=update_ply_preview,inputs=ply_update_inputs,outputs=ply_update_outputs,show_progress="hidden",trigger_mode="always_last",concurrency_limit=1,concurrency_id="ply_update",)for control in [ply_y_axis]:control.change(fn=update_ply_preview,inputs=ply_update_inputs,outputs=ply_update_outputs,show_progress="hidden",trigger_mode="always_last",concurrency_limit=1,concurrency_id="ply_update",)gr.Markdown("FlashImgs Space · © 2025 OpsiClear · wrapper licensed ""[AGPL-3.0](https://www.gnu.org/licenses/agpl-3.0.html) — source available "2 unmodified lineselem_id="app-footer",)if __name__ == "__main__":demo.queue(default_concurrency_limit=1, max_size=8).launch(server_name="0.0.0.0",server_port=int(os.environ.get("PORT", "7860")),css=APP_CSS,allowed_paths=[str(OUTPUT_ROOT)],)
20 unmodified lines21222320 unmodified lineshttps://huggingface.co/spaces/opsiclear-admin/flashimgs/resolve/main/wheels/flashimgs-0.1.0-py3-none-any.whlhttps://huggingface.co/spaces/opsiclear-admin/flashimgs/resolve/main/wheels/fussim-0.3.14-cp312-cp312-linux_x86_64.whlhttps://huggingface.co/spaces/opsiclear-admin/flashimgs/resolve/main/wheels/simple_sum_backend-0.1.0-cp312-cp312-linux_x86_64.whl20 unmodified lines212223242520 unmodified lineshttps://huggingface.co/spaces/opsiclear-admin/flashimgs/resolve/main/wheels/flashimgs-0.1.0-py3-none-any.whlhttps://huggingface.co/spaces/opsiclear-admin/flashimgs/resolve/main/wheels/fussim-0.3.14-cp312-cp312-linux_x86_64.whlhttps://huggingface.co/spaces/opsiclear-admin/flashimgs/resolve/main/wheels/simple_sum_backend-0.1.0-cp312-cp312-linux_x86_64.whl# Standard 3DGS mode: Faster-GS rasterizer (Apache-2.0), same CPython 3.12 / torch 2.11.0+cu130 / sm_120 build.https://huggingface.co/spaces/opsiclear-admin/flashimgs/resolve/main/wheels/fastergscudabackend-0.0.0-cp312-cp312-linux_x86_64.whl
123version https://git-lfs.github.com/spec/v1oid sha256:e7de26f77eaad623e02681a97814a5abfadf7d46333138a7154f3293b98a4394size 3996387123version https://git-lfs.github.com/spec/v1oid sha256:7c14d42508eb252640e0a2f8973147b3b6263f3304581f26d0bd770161c358dasize 113445123version https://git-lfs.github.com/spec/v1oid sha256:6cbcd2706826a3639ab34f127caa66ac2710e3160bf81de62994955bde7c1bafsize 186580
NOTICE+12-3
README.md+62-20
app.py+335-120
requirements.txt+2
wheels/fastergscudabackend-0.0.0-cp312-cp312-linux_x86_64.whlAdded+3
wheels/flashimgs-0.1.0-py3-none-any.whl+2-2