Skip to main content

Synchronized side-by-side 3D comparison viewer for Gradio — supports PLY and GLB files with shared camera control.

Project description

gradio_sync3dcompare

PyPI - Version Static Badge

Synchronized side-by-side 3D comparison viewer for Gradio — supports PLY and GLB files with shared camera control.

Installation

pip install gradio_sync3dcompare

Usage

import gradio as gr
from gradio_sync3dcompare import Sync3DCompare


with gr.Blocks(title="Sync3DCompare Demo") as demo:
    gr.Markdown("# Sync3DCompare — Synchronized 3D Comparison Viewer")
    gr.Markdown(
        "Compare two 3D assets side-by-side with synchronized orbit, pan, and zoom. "
        "Rotate one view and all others follow."
    )
    gr.Markdown(
        "### Two synchronized viewports. Upload `.ply` or `.glb` files manually into each pane."
    )
    Sync3DCompare(
        label="Two-Viewport 3D Comparison",
        value=[],
        render_mode="points",
        sync_camera=True,
        point_size_mode="auto",
        point_size=1.0,
        height=540,
        max_views=2,
    )


if __name__ == "__main__":
    demo.launch(ssr_mode=False)

Sync3DCompare

Initialization

name type default description
value
list[dict]| None
value = None None
label
str| None
value = "3D Comparison" None
render_mode
"points"| "native"
value = "points" None
sync_camera
bool
value = True None
point_size_mode
"auto"| "manual"
value = "auto" None
point_size
float
value = 1.0 None
max_point_size
float
value = 10.0 None
default_zoom
float
value = 1.0 None
min_zoom
float
value = 0.5 None
max_zoom
float
value = 16.0 None
height
int
value = 500 None
max_views
int
value = 4 None
num_views
int| None
value = None None
interactive
bool
value = True None
visible
bool
value = True None
elem_id
str| None
value = None None
elem_classes
list[str]| str| None
value = None None
render
bool
value = True None

Events

name description
change

User function

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).

  • When used as an Input, the component only impacts the input signature of the user function.
  • When used as an output, the component only impacts the return signature of the user function.

The code snippet below is accurate in cases where the component is used as both an input and an output.

  • As input: Should return, the output data received by the component from the user's function in the backend.
def predict(
    value: Unknown
) -> list[dict]| None:
    return value

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gradio_sync3dcompare-0.0.21.tar.gz (32.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gradio_sync3dcompare-0.0.21-py3-none-any.whl (310.6 kB view details)

Uploaded Python 3

File details

Details for the file gradio_sync3dcompare-0.0.21.tar.gz.

File metadata

  • Download URL: gradio_sync3dcompare-0.0.21.tar.gz
  • Upload date:
  • Size: 32.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for gradio_sync3dcompare-0.0.21.tar.gz
Algorithm Hash digest
SHA256 1055bc5e0b319dfb1cb6943238571852d2a34dc7be7d4f8b0f29712ca5d6a9a8
MD5 71f2bbf8346c6c1fafb7bb354e4f6c43
BLAKE2b-256 4f603df2d4ad44bf9cc019451b87d73cf6135777321275a78e2bf93d7533a359

See more details on using hashes here.

File details

Details for the file gradio_sync3dcompare-0.0.21-py3-none-any.whl.

File metadata

File hashes

Hashes for gradio_sync3dcompare-0.0.21-py3-none-any.whl
Algorithm Hash digest
SHA256 d45d5625952b5a096699d48acf25e02a95d66c15d60982842aa65a592e84dc26
MD5 c9025ab1fed5666a1c7ddc5ad295ab71
BLAKE2b-256 1b4d0c295779c8f041b3644c3818ae8bf0af32191b0383daa3e4c9a140b8b0eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page