Spaces:
Runtime error
Runtime error
Ethan Weber
commited on
Commit
·
8908918
1
Parent(s):
b16aa33
updates
Browse files
app.py
CHANGED
|
@@ -11,14 +11,25 @@ def predict(input_img):
|
|
| 11 |
|
| 12 |
_HEADER_ = '''
|
| 13 |
<h2>Toon3D: Seeing Cartoons from a New Perspective</h2>
|
| 14 |
-
|
| 15 |
Project page @ <a href='https://toon3d.studio/' target='_blank'>https://toon3d.studio/</a>
|
| 16 |
|
| 17 |
**Important Notes:**
|
| 18 |
-
-
|
| 19 |
-
-
|
| 20 |
'''
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
gradio_app = gr.Interface(
|
| 23 |
predict,
|
| 24 |
inputs=gr.Image(label="Select hot dog candidate", sources=['upload', 'webcam'], type="pil"),
|
|
@@ -31,7 +42,24 @@ with gr.Blocks() as demo:
|
|
| 31 |
with gr.Row(variant="panel"):
|
| 32 |
with gr.Column():
|
| 33 |
with gr.Row():
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
if __name__ == "__main__":
|
| 37 |
demo.launch()
|
|
|
|
| 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.<br>
|
| 15 |
Project page @ <a href='https://toon3d.studio/' target='_blank'>https://toon3d.studio/</a>
|
| 16 |
|
| 17 |
**Important Notes:**
|
| 18 |
+
- TODO 1
|
| 19 |
+
- TODO 2
|
| 20 |
'''
|
| 21 |
|
| 22 |
+
def check_input_images(input_images):
|
| 23 |
+
if input_images is None:
|
| 24 |
+
raise gr.Error("No images uploaded!")
|
| 25 |
+
|
| 26 |
+
def process_images(input_images):
|
| 27 |
+
|
| 28 |
+
for image in input_images:
|
| 29 |
+
print(image)
|
| 30 |
+
|
| 31 |
+
return input_images
|
| 32 |
+
|
| 33 |
gradio_app = gr.Interface(
|
| 34 |
predict,
|
| 35 |
inputs=gr.Image(label="Select hot dog candidate", sources=['upload', 'webcam'], type="pil"),
|
|
|
|
| 42 |
with gr.Row(variant="panel"):
|
| 43 |
with gr.Column():
|
| 44 |
with gr.Row():
|
| 45 |
+
input_images = gr.File(label="Upload Images", file_count="multiple", file_types=[".jpg", "jpeg", "png"])
|
| 46 |
+
with gr.Row():
|
| 47 |
+
process_data_button = gr.Button("Process Data", elem_id="process_data", variant="primary")
|
| 48 |
+
with gr.Row():
|
| 49 |
+
processed_data_zip = gr.File(label="Processed Data", file_count="single", file_types=[".zip"])
|
| 50 |
+
with gr.Column():
|
| 51 |
+
with gr.Row():
|
| 52 |
+
labeled_data = gr.File(label="Labeled Points", file_count="single", file_types=[".json"])
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
# mv_images = gr.State()
|
| 57 |
+
|
| 58 |
+
process_data_button.click(fn=check_input_images, inputs=[input_images]).success(
|
| 59 |
+
fn=process_images,
|
| 60 |
+
inputs=[input_images],
|
| 61 |
+
outputs=[processed_data_zip],
|
| 62 |
+
)
|
| 63 |
|
| 64 |
if __name__ == "__main__":
|
| 65 |
demo.launch()
|