Spaces:
Runtime error
Runtime error
improve page ui
Browse files
app.py
CHANGED
@@ -80,32 +80,31 @@ html_text = f"""
|
|
80 |
"""
|
81 |
|
82 |
with gr.Blocks() as demo:
|
83 |
-
gr.Markdown("""### Usage
|
84 |
-
|
85 |
-
Choose one of the following methods to edit the pose:
|
86 |
-
|
87 |
-
| Style | Description |
|
88 |
-
| -----------------| ----------------------------------------------------------------------------------------- |
|
89 |
-
| Pose recognition | Upload an image and click "Start edit". |
|
90 |
-
| Input json | Input json to "Json source" and click "Input Json", edit the width/height, then click "Start edit". |
|
91 |
-
| Free style | Edit the width/height, then click "Start edit". |
|
92 |
-
|
93 |
-
To save the pose image, click "Save".
|
94 |
-
To export the pose data, click "Save" and "Copy to clipboard" of "Json" section.
|
95 |
-
""")
|
96 |
with gr.Row():
|
97 |
with gr.Column(scale=1):
|
98 |
-
|
99 |
width = gr.Slider(label="Width", mininmum=512, maximum=1024, step=64, value=512, key="Width", interactive=True)
|
100 |
height = gr.Slider(label="Height", mininmum=512, maximum=1024, step=64, value=512, key="Height", interactive=True)
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
with gr.Column(scale=2):
|
106 |
html = gr.HTML(html_text)
|
107 |
-
|
108 |
-
|
|
|
|
|
|
|
109 |
- "ctrl + drag" to scale
|
110 |
- "alt + drag" to translate
|
111 |
- "shift + drag" to rotate(move right first, then up or down)
|
|
|
80 |
"""
|
81 |
|
82 |
with gr.Blocks() as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
with gr.Row():
|
84 |
with gr.Column(scale=1):
|
85 |
+
startBtn = gr.Button(value="Start edit")
|
86 |
width = gr.Slider(label="Width", mininmum=512, maximum=1024, step=64, value=512, key="Width", interactive=True)
|
87 |
height = gr.Slider(label="Height", mininmum=512, maximum=1024, step=64, value=512, key="Height", interactive=True)
|
88 |
+
with gr.Accordion(label="Pose estimation", open=False):
|
89 |
+
source = gr.Image(type="pil")
|
90 |
+
gr.Markdown("""push "Start edit" after estimation done.""")
|
91 |
+
with gr.Accordion(label="Json", open=False):
|
92 |
+
gr.Markdown("""
|
93 |
+
| inout | how to |
|
94 |
+
| -----------------| ----------------------------------------------------------------------------------------- |
|
95 |
+
| Import | Paste json to "Json source" and click "Import Json", edit the width/height, then click "Start edit". |
|
96 |
+
| Export | click "Save" and "Copy to clipboard" of "Json" section. |
|
97 |
+
""")
|
98 |
+
json = gr.JSON(label="Json", lines=10)
|
99 |
+
jsonInput = gr.Textbox(label="Json source", lines=10)
|
100 |
+
jsonInputBtn = gr.Button(value="Import Json")
|
101 |
with gr.Column(scale=2):
|
102 |
html = gr.HTML(html_text)
|
103 |
+
with gr.Row():
|
104 |
+
with gr.Column(scale=1):
|
105 |
+
saveBtn = gr.Button(value="Save")
|
106 |
+
with gr.Column(scale=7):
|
107 |
+
gr.Markdown("""
|
108 |
- "ctrl + drag" to scale
|
109 |
- "alt + drag" to translate
|
110 |
- "shift + drag" to rotate(move right first, then up or down)
|