test: debug geoloc on HF
Browse files- app/geolocalisation/js_geolocation.py +13 -11
- app/mode_simple.py +2 -1
app/geolocalisation/js_geolocation.py
CHANGED
@@ -38,17 +38,19 @@ js_geocode = """
|
|
38 |
def display_location(location_json, individual):
|
39 |
geo_dict = json.loads(location_json)
|
40 |
print(geo_dict)
|
41 |
-
latitude = geo_dict["latitude"]
|
42 |
-
longitude = geo_dict["longitude"]
|
43 |
-
geolocalisation = create_geolocalisation_object(latitude, longitude, "NA")
|
44 |
-
individual = save_geolocalisation_to_json(geolocalisation, individual)
|
45 |
-
locationtext = gr.Textbox(
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
print("Done displaying location")
|
51 |
-
|
|
|
|
|
52 |
|
53 |
# def display_location(location_json):
|
54 |
# return location_json
|
|
|
38 |
def display_location(location_json, individual):
|
39 |
geo_dict = json.loads(location_json)
|
40 |
print(geo_dict)
|
41 |
+
# latitude = geo_dict["latitude"]
|
42 |
+
# longitude = geo_dict["longitude"]
|
43 |
+
# geolocalisation = create_geolocalisation_object(latitude, longitude, "NA")
|
44 |
+
# individual = save_geolocalisation_to_json(geolocalisation, individual)
|
45 |
+
# locationtext = gr.Textbox(
|
46 |
+
# f"Latitude: {latitude} | Longitude: {longitude}",
|
47 |
+
# visible=True,
|
48 |
+
# show_label=False,
|
49 |
+
# interactive=False)
|
50 |
+
# print("Done displaying location")
|
51 |
+
location_data = gr.JSON(value=geo_dict, label="Identified GPS Location", visible=True)
|
52 |
+
#return locationtext, individual
|
53 |
+
return location_data, individual
|
54 |
|
55 |
# def display_location(location_json):
|
56 |
# return location_json
|
app/mode_simple.py
CHANGED
@@ -110,7 +110,8 @@ with gr.Blocks(theme='shivi/calm_seafoam') as simple:
|
|
110 |
btn_gpslocation.click(None, [], [], js=js_geocode)
|
111 |
hidden_input.change(display_location,
|
112 |
inputs=[hidden_input, individual],
|
113 |
-
outputs=[locationtext, individual])
|
|
|
114 |
|
115 |
# ---------------------------------------------------------
|
116 |
# Dead and Wounded Buttons
|
|
|
110 |
btn_gpslocation.click(None, [], [], js=js_geocode)
|
111 |
hidden_input.change(display_location,
|
112 |
inputs=[hidden_input, individual],
|
113 |
+
#outputs=[locationtext, individual])
|
114 |
+
outputs=[location_data, individual])
|
115 |
|
116 |
# ---------------------------------------------------------
|
117 |
# Dead and Wounded Buttons
|