feat: translate UI to English
Browse files
app.py
CHANGED
|
@@ -81,35 +81,35 @@ def process_files(file_objs, strength):
|
|
| 81 |
shutil.rmtree(temp_dir)
|
| 82 |
return zip_path
|
| 83 |
|
| 84 |
-
# Gradio
|
| 85 |
with gr.Blocks(title="Normal Map Generator", theme=gr.themes.Soft()) as demo:
|
| 86 |
gr.Markdown("# 🗺️ Normal Map Generator")
|
| 87 |
-
gr.Markdown("
|
| 88 |
|
| 89 |
with gr.Tabs():
|
| 90 |
-
#
|
| 91 |
-
with gr.Tab("
|
| 92 |
with gr.Row():
|
| 93 |
with gr.Column():
|
| 94 |
-
img_input = gr.Image(type="pil", label="
|
| 95 |
-
strength_slider_1 = gr.Slider(minimum=0.1, maximum=10.0, value=2.0, step=0.1, label="
|
| 96 |
-
btn_single = gr.Button("
|
| 97 |
with gr.Column():
|
| 98 |
-
img_output = gr.Image(type="pil", label="Normal Map
|
| 99 |
|
| 100 |
btn_single.click(fn=process_single, inputs=[img_input, strength_slider_1], outputs=img_output)
|
| 101 |
|
| 102 |
-
#
|
| 103 |
-
with gr.Tab("
|
| 104 |
-
gr.Markdown("
|
| 105 |
with gr.Row():
|
| 106 |
with gr.Column():
|
| 107 |
-
# file_count="directory"
|
| 108 |
-
folder_input = gr.File(file_count="directory", label="
|
| 109 |
-
strength_slider_2 = gr.Slider(minimum=0.1, maximum=10.0, value=2.0, step=0.1, label="
|
| 110 |
-
btn_folder = gr.Button("
|
| 111 |
with gr.Column():
|
| 112 |
-
file_output = gr.File(label="
|
| 113 |
|
| 114 |
btn_folder.click(fn=process_files, inputs=[folder_input, strength_slider_2], outputs=file_output)
|
| 115 |
|
|
|
|
| 81 |
shutil.rmtree(temp_dir)
|
| 82 |
return zip_path
|
| 83 |
|
| 84 |
+
# Gradio Interface
|
| 85 |
with gr.Blocks(title="Normal Map Generator", theme=gr.themes.Soft()) as demo:
|
| 86 |
gr.Markdown("# 🗺️ Normal Map Generator")
|
| 87 |
+
gr.Markdown("Create normal maps from standard images for 3D modeling and texturing.")
|
| 88 |
|
| 89 |
with gr.Tabs():
|
| 90 |
+
# SINGLE IMAGE TAB
|
| 91 |
+
with gr.Tab("Single Image"):
|
| 92 |
with gr.Row():
|
| 93 |
with gr.Column():
|
| 94 |
+
img_input = gr.Image(type="pil", label="Input Image")
|
| 95 |
+
strength_slider_1 = gr.Slider(minimum=0.1, maximum=10.0, value=2.0, step=0.1, label="Normal Map Strength")
|
| 96 |
+
btn_single = gr.Button("Generate", variant="primary")
|
| 97 |
with gr.Column():
|
| 98 |
+
img_output = gr.Image(type="pil", label="Normal Map Result", format="png")
|
| 99 |
|
| 100 |
btn_single.click(fn=process_single, inputs=[img_input, strength_slider_1], outputs=img_output)
|
| 101 |
|
| 102 |
+
# FOLDER/BATCH TAB
|
| 103 |
+
with gr.Tab("Folder (Batch Processing)"):
|
| 104 |
+
gr.Markdown("Select a folder or drag and drop multiple images. All images will be processed and provided as a ZIP file.")
|
| 105 |
with gr.Row():
|
| 106 |
with gr.Column():
|
| 107 |
+
# file_count="directory" allows folder upload
|
| 108 |
+
folder_input = gr.File(file_count="directory", label="Upload Folder / Files")
|
| 109 |
+
strength_slider_2 = gr.Slider(minimum=0.1, maximum=10.0, value=2.0, step=0.1, label="Normal Map Strength")
|
| 110 |
+
btn_folder = gr.Button("Generate Batch and Download", variant="primary")
|
| 111 |
with gr.Column():
|
| 112 |
+
file_output = gr.File(label="Download ZIP File")
|
| 113 |
|
| 114 |
btn_folder.click(fn=process_files, inputs=[folder_input, strength_slider_2], outputs=file_output)
|
| 115 |
|