Metadata-Version: 2.4 Name: gradio_gaussian_render Version: 0.0.3 Summary: gradio_gaussian_render_arkit_withBSData Author-email: YOUR NAME License-Expression: Apache-2.0 Keywords: gradio-custom-component,gradio-template-SimpleImage,webrtc aliyun gradio Classifier: Development Status :: 3 - Alpha Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Topic :: Scientific/Engineering Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence Classifier: Topic :: Scientific/Engineering :: Visualization Requires-Python: >=3.10 Requires-Dist: gradio<6.0,>=4.0 Provides-Extra: dev Requires-Dist: build; extra == 'dev' Requires-Dist: twine; extra == 'dev' Description-Content-Type: text/markdown # `gradio_gaussian_render` Static Badge gradio_gaussian_render_arkit_withBSData ## Installation ```bash pip install gradio_gaussian_render ``` ## Usage ```python import gradio as gr from pathlib import Path # 修改: 将 Path 对象包装为列表 gr.set_static_paths([Path.cwd().absolute()/"assets/"]) from gradio_gaussian_render import gaussian_render assetPrefix = 'gradio_api/file=assets/' def doLoadAudio(): print('do LoadAudio') audio_file = '/Users/yexiaodan/Documents/code/gradio_gaussian_render/assets/BarackObama.wav' audio_path = assetPrefix + 'BarackObama.wav' print(audio_path) return audio_file, audio_path def doRender(): assets = assetPrefix + 'arkitWithBSData.zip' print("do render") return assets with gr.Blocks() as demo: gs = gaussian_render(width = 300, height = 400) renderButton = gr.Button('渲染') audio_output = gr.Audio(label="Audio Output") text_output = gr.Textbox(label="Audio URL") asset_output = gr.Textbox(label="Zip URL") assets = assetPrefix + 'arkitWithBSData.zip' renderButton.click(doLoadAudio, inputs=[], outputs=[audio_output, text_output] ).success( doLoadAudio, inputs=[], outputs=[audio_output, text_output], js='''(audio_output, text_output) => {window.loadAudio(text_output);}''' ).success( doRender, inputs=[], outputs=[asset_output] ).success( doRender, inputs=[], outputs=[asset_output], js='''(asset_output) => {window.start(asset_output);}''' ) if __name__ == "__main__": demo.launch() ``` ## `gaussian_render` ### Initialization
name type default description
container ```python bool ``` True If True, will place the component in a container - providing some extra padding around the border.
scale ```python int | None ``` None relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.
min_width ```python int ``` 160 minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
interactive ```python bool | None ``` None if True, will allow users to upload and edit an image; if False, can only be used to display images. If not provided, this is inferred based on whether the component is used as an input or output.
visible ```python bool ``` True If False, component will be hidden.
elem_id ```python str | None ``` None An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
elem_classes ```python list[str] | str | None ``` None An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
render ```python bool ``` True If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
key ```python int | str | None ``` None if assigned, will be used to assume identity across a re-render. Components that have the same key across a re-render will have their value preserved.
height ```python int | str | None ``` None the height of the webrtc component
width ```python int | str | None ``` None the width of the webrtc component
assets ```python str | None ``` None None
audio_url ```python str | None ``` None None
### Events | name | description | |:-----|:------------| | `start` | | | `start_render` | | ### 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 output:** Is passed, passes text value as a {str} into the function. - **As input:** Should return, expects a media stream for video play. ```python def predict( value: str | None ) -> Any: return value ```