Spaces:
Runtime error
Runtime error
Ethan Weber
commited on
Commit
·
95f29af
1
Parent(s):
0080de0
file upload
Browse files
app.py
CHANGED
|
@@ -7,14 +7,31 @@ pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotd
|
|
| 7 |
@spaces.GPU
|
| 8 |
def predict(input_img):
|
| 9 |
predictions = pipeline(input_img)
|
| 10 |
-
return input_img, {p["label"]: p["score"] for p in predictions}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
gradio_app = gr.Interface(
|
| 13 |
predict,
|
| 14 |
inputs=gr.Image(label="Select hot dog candidate", sources=['upload', 'webcam'], type="pil"),
|
| 15 |
outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
|
| 16 |
-
title="
|
| 17 |
)
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
if __name__ == "__main__":
|
| 20 |
gradio_app.launch()
|
|
|
|
| 7 |
@spaces.GPU
|
| 8 |
def predict(input_img):
|
| 9 |
predictions = pipeline(input_img)
|
| 10 |
+
return input_img, {p["label"]: p["score"] for p in predictions}
|
| 11 |
+
|
| 12 |
+
_HEADER_ = '''
|
| 13 |
+
<h2>Toon3D: Seeing Cartoons from a New Perspective</h2>
|
| 14 |
+
**Toon3D** lifts cartoons into 3D via aligning and warping backprojected monocular depth predictions..
|
| 15 |
+
Project page @ <a href='https://toon3d.studio/' target='_blank'>https://toon3d.studio/</a>
|
| 16 |
+
|
| 17 |
+
**Important Notes:**
|
| 18 |
+
- Our demo can export a .obj mesh with vertex colors or a .glb mesh now. If you prefer to export a .obj mesh with a **texture map**, please refer to our <a href='https://github.com/TencentARC/InstantMesh?tab=readme-ov-file#running-with-command-line' target='_blank'>Github Repo</a>.
|
| 19 |
+
- The 3D mesh generation results highly depend on the quality of generated multi-view images. Please try a different **seed value** if the result is unsatisfying (Default: 42).
|
| 20 |
+
'''
|
| 21 |
|
| 22 |
gradio_app = gr.Interface(
|
| 23 |
predict,
|
| 24 |
inputs=gr.Image(label="Select hot dog candidate", sources=['upload', 'webcam'], type="pil"),
|
| 25 |
outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
|
| 26 |
+
title="Toon3D",
|
| 27 |
)
|
| 28 |
|
| 29 |
+
with gr.Blocks() as demo:
|
| 30 |
+
gr.Markdown(_HEADER_)
|
| 31 |
+
with gr.Row(variant="panel"):
|
| 32 |
+
with gr.Column():
|
| 33 |
+
with gr.Row():
|
| 34 |
+
input = gr.File(file_count="directory")
|
| 35 |
+
|
| 36 |
if __name__ == "__main__":
|
| 37 |
gradio_app.launch()
|