Python library for easily interacting with trained machine learning models
Project description
gradio_foliumtest
Create a map with folium and display it on the web with Gradio!
Example usage
import gradio as gr
from gradio_foliumtest import FoliumTest
from typing import Literal
from folium import Map
LAT_LONG_MAP = {
"New York City": (40.7128, -74.0060),
"London": (51.5074, -0.1278),
"San Francisco": (37.7749, -122.4194),
"Tokyo": (35.6762, 139.6503),
"Miami": (25.7617, -80.1918),
}
def get_city(city: Literal["New York City", "London", "San Francisco", "Tokyo", "Miami"]):
city = city or "Miami"
return Map(location=LAT_LONG_MAP[city], zoom_start=12)
with gr.Blocks() as demo:
with gr.Row():
with gr.Column():
city = gr.Radio(choices=["New York City", "London", "San Francisco", "Tokyo", "Miami"],
label="City")
with gr.Column():
map_ = FoliumTest(label="Foo")
city.change(get_city, city, map_)
demo.launch()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gradio_foliumtest-0.0.1.tar.gz
(32.6 kB
view hashes)
Built Distribution
Close
Hashes for gradio_foliumtest-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bae78fb09b0f0ccbba7e58415ec7245a2903ec99dd15f8af3bc50aea9875ad67 |
|
MD5 | 8659508fc44c89c0f3d47afa86bcb734 |
|
BLAKE2b-256 | a8918b00f0306bce345ae63a550a9f6a3703b341b88615211f965dc2c448de1d |