Spaces:
Runtime error
Runtime error
Goodsea
commited on
Commit
·
4670957
1
Parent(s):
9f2d1fe
update layout
Browse files
app.py
CHANGED
|
@@ -114,33 +114,42 @@ with gr.Blocks() as demo:
|
|
| 114 |
"Bu uygulamada ekran görüntüsü sürükleyip bırakarak AFAD'a enkaz bildirimi yapabilirsiniz. Mesajı metin olarak da girebilirsiniz, tam adresi ayrıştırıp döndürür. API olarak kullanmak isterseniz sayfanın en altında use via api'ya tıklayın."
|
| 115 |
)
|
| 116 |
with gr.Row():
|
| 117 |
-
|
|
|
|
|
|
|
| 118 |
|
| 119 |
with gr.Column():
|
| 120 |
-
text_area = gr.
|
| 121 |
text_area_button = gr.Button(value="Metni Yükle", label="Submit")
|
|
|
|
| 122 |
open_api_text = gr.Textbox(label="Tam Adres")
|
| 123 |
-
|
| 124 |
with gr.Column():
|
| 125 |
with gr.Row():
|
| 126 |
-
city = gr.Textbox(label="İl", interactive=True)
|
| 127 |
-
distinct = gr.Textbox(label="İlçe", interactive=True)
|
| 128 |
with gr.Row():
|
| 129 |
-
neighbourhood = gr.Textbox(
|
| 130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
with gr.Row():
|
| 132 |
-
tel = gr.Textbox(label="Telefon", interactive=True)
|
| 133 |
with gr.Row():
|
| 134 |
-
name_surname = gr.Textbox(
|
| 135 |
-
|
|
|
|
|
|
|
| 136 |
with gr.Row():
|
| 137 |
-
no = gr.Textbox(label="Kapı No", interactive=True)
|
| 138 |
|
| 139 |
-
|
| 140 |
get_parsed_address,
|
| 141 |
inputs=img_area,
|
| 142 |
outputs=open_api_text,
|
| 143 |
-
api_name="
|
| 144 |
)
|
| 145 |
|
| 146 |
text_area_button.click(
|
|
@@ -154,7 +163,7 @@ with gr.Blocks() as demo:
|
|
| 154 |
)
|
| 155 |
|
| 156 |
submit_button = gr.Button(value="Veriyi Birimlere Yolla")
|
| 157 |
-
|
| 158 |
done_text = gr.Textbox(label="Done", value="Not Done", visible=False)
|
| 159 |
submit_button.click(update_component, outputs=done_text)
|
| 160 |
for txt in [city, distinct, neighbourhood, street, address, tel, name_surname, no]:
|
|
|
|
| 114 |
"Bu uygulamada ekran görüntüsü sürükleyip bırakarak AFAD'a enkaz bildirimi yapabilirsiniz. Mesajı metin olarak da girebilirsiniz, tam adresi ayrıştırıp döndürür. API olarak kullanmak isterseniz sayfanın en altında use via api'ya tıklayın."
|
| 115 |
)
|
| 116 |
with gr.Row():
|
| 117 |
+
with gr.Column():
|
| 118 |
+
img_area = gr.Image(label="Ekran Görüntüsü yükleyin 👇")
|
| 119 |
+
img_area_button = gr.Button(value="Görüntüyü İşle", label="Submit")
|
| 120 |
|
| 121 |
with gr.Column():
|
| 122 |
+
text_area = gr.Textbox(label="Metin yükleyin 👇 ", lines=8)
|
| 123 |
text_area_button = gr.Button(value="Metni Yükle", label="Submit")
|
| 124 |
+
|
| 125 |
open_api_text = gr.Textbox(label="Tam Adres")
|
| 126 |
+
|
| 127 |
with gr.Column():
|
| 128 |
with gr.Row():
|
| 129 |
+
city = gr.Textbox(label="İl", interactive=True, show_progress=False)
|
| 130 |
+
distinct = gr.Textbox(label="İlçe", interactive=True, show_progress=False)
|
| 131 |
with gr.Row():
|
| 132 |
+
neighbourhood = gr.Textbox(
|
| 133 |
+
label="Mahalle", interactive=True, show_progress=False
|
| 134 |
+
)
|
| 135 |
+
street = gr.Textbox(
|
| 136 |
+
label="Sokak/Cadde/Bulvar", interactive=True, show_progress=False
|
| 137 |
+
)
|
| 138 |
with gr.Row():
|
| 139 |
+
tel = gr.Textbox(label="Telefon", interactive=True, show_progress=False)
|
| 140 |
with gr.Row():
|
| 141 |
+
name_surname = gr.Textbox(
|
| 142 |
+
label="İsim Soyisim", interactive=True, show_progress=False
|
| 143 |
+
)
|
| 144 |
+
address = gr.Textbox(label="Adres", interactive=True, show_progress=False)
|
| 145 |
with gr.Row():
|
| 146 |
+
no = gr.Textbox(label="Kapı No", interactive=True, show_progress=False)
|
| 147 |
|
| 148 |
+
img_area_button.click(
|
| 149 |
get_parsed_address,
|
| 150 |
inputs=img_area,
|
| 151 |
outputs=open_api_text,
|
| 152 |
+
api_name="upload-image",
|
| 153 |
)
|
| 154 |
|
| 155 |
text_area_button.click(
|
|
|
|
| 163 |
)
|
| 164 |
|
| 165 |
submit_button = gr.Button(value="Veriyi Birimlere Yolla")
|
| 166 |
+
submit_button.click(save_deta_db, open_api_text)
|
| 167 |
done_text = gr.Textbox(label="Done", value="Not Done", visible=False)
|
| 168 |
submit_button.click(update_component, outputs=done_text)
|
| 169 |
for txt in [city, distinct, neighbourhood, street, address, tel, name_surname, no]:
|