-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix 3d model examples * format fix * cache_examples in image demo * fix cached examples * fixed cached example bug * fixed formatting * fixed tests Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
- Loading branch information
1 parent
e94e3f0
commit 873060a
Showing
9 changed files
with
54 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import os.path | ||
import gradio as gr | ||
|
||
import time | ||
|
||
def load_mesh(mesh_file_name): | ||
time.sleep(2) | ||
return mesh_file_name | ||
|
||
iface = gr.Interface( | ||
load_mesh, | ||
gr.inputs.Image3D(), | ||
gr.outputs.Image3D(clear_color=[0.8, 0.2, 0.2, 1.0]) | ||
fn=load_mesh, | ||
inputs=gr.inputs.Image3D(), | ||
outputs=gr.outputs.Image3D(clear_color=[0.8, 0.2, 0.2, 1.0]), | ||
examples=[["files/Bunny.obj"], ["files/Duck.glb"]] | ||
) | ||
|
||
if __name__ == "__main__": | ||
iface.launch() | ||
iface.launch(cache_examples=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
<script lang="ts"> | ||
export let value: string; | ||
export let examples_dir: string; | ||
import type { FileData } from "./types"; | ||
export let value: FileData; | ||
</script> | ||
|
||
<!-- svelte-ignore a11y-missing-attribute --> | ||
<img class="input-Image3D-example h-24 max-w-none" src={examples_dir + value} /> | ||
<div class="input-image3D-example">{value}</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import Component from "./Image3D.svelte"; | ||
import ExampleComponent from "./Example.svelte"; | ||
import { loadAsData } from "../../utils/example_processors"; | ||
import { loadAsFile } from "../../utils/example_processors"; | ||
|
||
export default { | ||
component: Component, | ||
example: ExampleComponent, | ||
process_example: loadAsData | ||
process_example: loadAsFile | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface FileData { | ||
name: string; | ||
size: number; | ||
data: string; | ||
is_example: false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters