Spaces:
Sleeping
Sleeping
BenitoSchwankhart
commited on
Commit
·
58e831f
1
Parent(s):
eb7cf92
Initial commit: Add IDML Konverter app
Browse files- README copy.md +14 -0
- app.py +57 -0
- horizontal_layout.idml +0 -0
- horizontal_layout_filled.idml +0 -0
- requirements.txt +1 -0
- test_vertical-Vorlage.idml +0 -0
README copy.md
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: IDML Konverter
|
3 |
+
emoji: 📄
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: indigo
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: 4.19.2
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
---
|
11 |
+
|
12 |
+
# IDML Konverter by Coffeestudios
|
13 |
+
|
14 |
+
Eine Gradio App zur Konvertierung von IDML Dateien.
|
app.py
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import time
|
3 |
+
|
4 |
+
def simulate_conversion(input_file):
|
5 |
+
if input_file is None:
|
6 |
+
return None
|
7 |
+
|
8 |
+
# Simuliere Verarbeitungszeit
|
9 |
+
time.sleep(5)
|
10 |
+
|
11 |
+
# Nach Timer Output File zurückgeben
|
12 |
+
return "horizontal_layout_filled.idml"
|
13 |
+
|
14 |
+
# Erstelle die Gradio-Oberfläche
|
15 |
+
with gr.Blocks() as demo:
|
16 |
+
gr.Markdown("# IDML Konverter")
|
17 |
+
|
18 |
+
with gr.Row():
|
19 |
+
# Input-Bereich
|
20 |
+
with gr.Column():
|
21 |
+
gr.Markdown("## Input")
|
22 |
+
input_file = gr.File(
|
23 |
+
label="Input File",
|
24 |
+
value="test_vertical-Vorlage.idml",
|
25 |
+
file_types=[".idml"],
|
26 |
+
interactive=False
|
27 |
+
)
|
28 |
+
|
29 |
+
# Template-Bereich
|
30 |
+
with gr.Column():
|
31 |
+
gr.Markdown("## Template")
|
32 |
+
template_file = gr.File(
|
33 |
+
label="Template File",
|
34 |
+
value="horizontal_layout.idml",
|
35 |
+
file_types=[".idml"],
|
36 |
+
interactive=False
|
37 |
+
)
|
38 |
+
|
39 |
+
# Konvertierungs-Button
|
40 |
+
convert_btn = gr.Button("Konvertierung starten")
|
41 |
+
|
42 |
+
# Ausgabe-Bereich
|
43 |
+
output_file = gr.File(
|
44 |
+
label="Output File",
|
45 |
+
interactive=False
|
46 |
+
)
|
47 |
+
|
48 |
+
# Verknüpfe den Button mit der Konvertierungsfunktion
|
49 |
+
convert_btn.click(
|
50 |
+
fn=simulate_conversion,
|
51 |
+
inputs=[input_file],
|
52 |
+
outputs=[output_file],
|
53 |
+
api_name="convert"
|
54 |
+
)
|
55 |
+
|
56 |
+
if __name__ == "__main__":
|
57 |
+
demo.launch()
|
horizontal_layout.idml
ADDED
Binary file (56 kB). View file
|
|
horizontal_layout_filled.idml
ADDED
Binary file (65 kB). View file
|
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
gradio
|
test_vertical-Vorlage.idml
ADDED
Binary file (56.9 kB). View file
|
|