Spaces:
Runtime error
Runtime error
Ansal
commited on
Commit
•
3819023
1
Parent(s):
d0c40eb
change
Browse files- app.py +3 -0
- requirements.txt +7 -9
- shared.py +38 -0
app.py
CHANGED
@@ -1,13 +1,16 @@
|
|
|
|
1 |
import tempfile
|
2 |
from PIL import Image
|
3 |
from pathlib import Path
|
4 |
from shiny import App, Inputs, Outputs, Session, reactive, render, ui
|
5 |
from shiny.types import FileInfo
|
|
|
6 |
import torch
|
7 |
import numpy as np
|
8 |
import os
|
9 |
from transformers import SamModel
|
10 |
import torchvision.transforms as transforms
|
|
|
11 |
|
12 |
image_resize_transform = transforms.Compose([
|
13 |
transforms.Resize((1024, 1024)),
|
|
|
1 |
+
import pandas as pd
|
2 |
import tempfile
|
3 |
from PIL import Image
|
4 |
from pathlib import Path
|
5 |
from shiny import App, Inputs, Outputs, Session, reactive, render, ui
|
6 |
from shiny.types import FileInfo
|
7 |
+
import json
|
8 |
import torch
|
9 |
import numpy as np
|
10 |
import os
|
11 |
from transformers import SamModel
|
12 |
import torchvision.transforms as transforms
|
13 |
+
import matplotlib.pyplot as plt
|
14 |
|
15 |
image_resize_transform = transforms.Compose([
|
16 |
transforms.Resize((1024, 1024)),
|
requirements.txt
CHANGED
@@ -1,9 +1,7 @@
|
|
1 |
-
shiny
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
transformers
|
9 |
-
torchvision
|
|
|
1 |
+
shiny
|
2 |
+
shinywidgets
|
3 |
+
ipyleaflet
|
4 |
+
geopy
|
5 |
+
faicons
|
6 |
+
requests
|
7 |
+
tempfile
|
|
|
|
shared.py
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ipyleaflet import basemaps
|
2 |
+
|
3 |
+
BASEMAPS = {
|
4 |
+
"WorldImagery": basemaps.Esri.WorldImagery,
|
5 |
+
"Mapnik": basemaps.OpenStreetMap.Mapnik,
|
6 |
+
"Positron": basemaps.CartoDB.Positron,
|
7 |
+
"DarkMatter": basemaps.CartoDB.DarkMatter,
|
8 |
+
"NatGeoWorldMap": basemaps.Esri.NatGeoWorldMap,
|
9 |
+
"France": basemaps.OpenStreetMap.France,
|
10 |
+
"DE": basemaps.OpenStreetMap.DE,
|
11 |
+
}
|
12 |
+
|
13 |
+
|
14 |
+
CITIES = {
|
15 |
+
"New York": {"latitude": 40.7128, "longitude": -74.0060, "altitude": 33},
|
16 |
+
"London": {"latitude": 51.5074, "longitude": -0.1278, "altitude": 36},
|
17 |
+
"Paris": {"latitude": 48.8566, "longitude": 2.3522, "altitude": 35},
|
18 |
+
"Tokyo": {"latitude": 35.6895, "longitude": 139.6917, "altitude": 44},
|
19 |
+
"Sydney": {"latitude": -33.8688, "longitude": 151.2093, "altitude": 39},
|
20 |
+
"Los Angeles": {"latitude": 34.0522, "longitude": -118.2437, "altitude": 71},
|
21 |
+
"Berlin": {"latitude": 52.5200, "longitude": 13.4050, "altitude": 34},
|
22 |
+
"Rome": {"latitude": 41.9028, "longitude": 12.4964, "altitude": 21},
|
23 |
+
"Beijing": {"latitude": 39.9042, "longitude": 116.4074, "altitude": 44},
|
24 |
+
"Moscow": {"latitude": 55.7558, "longitude": 37.6176, "altitude": 156},
|
25 |
+
"Cairo": {"latitude": 30.0444, "longitude": 31.2357, "altitude": 23},
|
26 |
+
"Rio de Janeiro": {"latitude": -22.9068, "longitude": -43.1729, "altitude": 8},
|
27 |
+
"Toronto": {"latitude": 43.6511, "longitude": -79.3832, "altitude": 76},
|
28 |
+
"Dubai": {"latitude": 25.2769, "longitude": 55.2963, "altitude": 52},
|
29 |
+
"Mumbai": {"latitude": 19.0760, "longitude": 72.8777, "altitude": 14},
|
30 |
+
"Seoul": {"latitude": 37.5665, "longitude": 126.9780, "altitude": 38},
|
31 |
+
"Madrid": {"latitude": 40.4168, "longitude": -3.7038, "altitude": 667},
|
32 |
+
"Amsterdam": {"latitude": 52.3676, "longitude": 4.9041, "altitude": -2},
|
33 |
+
"Buenos Aires": {"latitude": -34.6037, "longitude": -58.3816, "altitude": 25},
|
34 |
+
"Stockholm": {"latitude": 59.3293, "longitude": 18.0686, "altitude": 14},
|
35 |
+
"Boulder": {"latitude": 40.0150, "longitude": -105.2705, "altitude": 1634},
|
36 |
+
"Lhasa": {"latitude": 29.6500, "longitude": 91.1000, "altitude": 3650},
|
37 |
+
"Khatmandu": {"latitude": 27.7172, "longitude": 85.3240, "altitude": 1400},
|
38 |
+
}
|