MynooMuz commited on
Commit
0475f02
·
1 Parent(s): 6254392

feat: translate UI to English

Browse files
Files changed (1) hide show
  1. app.py +16 -16
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 Arayüzü
85
  with gr.Blocks(title="Normal Map Generator", theme=gr.themes.Soft()) as demo:
86
  gr.Markdown("# 🗺️ Normal Map Generator")
87
- gr.Markdown("Standart görsellerden 3D modelleme ve texturing için normal map'ler oluşturun.")
88
 
89
  with gr.Tabs():
90
- # TEKLİ GÖRSEL SEKMESİ
91
- with gr.Tab("Tekli Görsel"):
92
  with gr.Row():
93
  with gr.Column():
94
- img_input = gr.Image(type="pil", label="Girdi Görseli")
95
- strength_slider_1 = gr.Slider(minimum=0.1, maximum=10.0, value=2.0, step=0.1, label="Derinlik Şiddeti (Strength)")
96
- btn_single = gr.Button("Oluştur", variant="primary")
97
  with gr.Column():
98
- img_output = gr.Image(type="pil", label="Normal Map Sonucu", format="png")
99
 
100
  btn_single.click(fn=process_single, inputs=[img_input, strength_slider_1], outputs=img_output)
101
 
102
- # KLASÖR/TOPLU İŞLEM SEKMESİ
103
- with gr.Tab("Klasör (Toplu İşlem)"):
104
- gr.Markdown("Bir klasör seçin veya birden fazla görseli sürükleyip bırakın. Tüm görseller işlenip size bir ZIP dosyası olarak sunulacaktır.")
105
  with gr.Row():
106
  with gr.Column():
107
- # file_count="directory" klasör yüklemeye izin verir
108
- folder_input = gr.File(file_count="directory", label="Klasör / Dosyalar Yükle")
109
- strength_slider_2 = gr.Slider(minimum=0.1, maximum=10.0, value=2.0, step=0.1, label="Derinlik Şiddeti (Strength)")
110
- btn_folder = gr.Button("Toplu Oluştur ve İndir", variant="primary")
111
  with gr.Column():
112
- file_output = gr.File(label="İndirilebilir ZIP Dosyası")
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