Spaces:
Sleeping
Sleeping
florinbarbisch
commited on
Commit
·
ab6af5b
1
Parent(s):
e7fbfcc
Added: static tiles
Browse files- .env.template +1 -3
- docker-compose.yaml +11 -35
- pages/2_Perform_Crop_Classification.py +5 -17
.env.template
CHANGED
@@ -1,3 +1 @@
|
|
1 |
-
|
2 |
-
TITILER_ENDPOINT=
|
3 |
-
COG_URL=
|
|
|
1 |
+
TILE_LAYER_URL=
|
|
|
|
docker-compose.yaml
CHANGED
@@ -1,24 +1,16 @@
|
|
1 |
version: '3.8'
|
2 |
|
3 |
services:
|
4 |
-
|
5 |
-
image:
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
- PORT=8000
|
10 |
-
- WORKERS_PER_CORE=1
|
11 |
-
- GDAL_HTTP_MERGE_CONSECUTIVE_RANGES=YES
|
12 |
-
- CPL_VSIL_CURL_ALLOWED_EXTENSIONS=".tif,.ovr"
|
13 |
-
- GDAL_CACHEMAX=200
|
14 |
-
- CPL_VSIL_CURL_CACHE_SIZE=200000000
|
15 |
-
- VSI_CACHE=TRUE
|
16 |
-
- VSI_CACHE_SIZE=5000000
|
17 |
-
- GDAL_HTTP_MULTIPLEX=YES
|
18 |
-
- GDAL_HTTP_VERSION=2
|
19 |
expose:
|
20 |
-
-
|
21 |
-
|
|
|
|
|
22 |
|
23 |
cloudflared:
|
24 |
image: cloudflare/cloudflared
|
@@ -28,23 +20,7 @@ services:
|
|
28 |
- "TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN}"
|
29 |
restart: unless-stopped
|
30 |
depends_on:
|
31 |
-
-
|
32 |
-
- minio
|
33 |
command: tunnel run --protocol http2
|
34 |
|
35 |
-
|
36 |
-
image: quay.io/minio/minio
|
37 |
-
container_name: minio
|
38 |
-
hostname: minio
|
39 |
-
environment:
|
40 |
-
- "MINIO_ROOT_USER=${MINIO_ROOT_USER}"
|
41 |
-
- "MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}"
|
42 |
-
volumes:
|
43 |
-
- ~/minio/data:/data
|
44 |
-
expose:
|
45 |
-
- 9000
|
46 |
-
ports:
|
47 |
-
- 9001:9001
|
48 |
-
- 9009:9000
|
49 |
-
command: server /data --console-address ":9001"
|
50 |
-
restart: unless-stopped
|
|
|
1 |
version: '3.8'
|
2 |
|
3 |
services:
|
4 |
+
bat-tiles:
|
5 |
+
image: python:3.9-slim
|
6 |
+
hostname: bat-tiles
|
7 |
+
container_name: bat-tiles
|
8 |
+
command: python3 -m http.server 8080
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
expose:
|
10 |
+
- 8080
|
11 |
+
volumes:
|
12 |
+
- /bat-tiles:/bat-tiles
|
13 |
+
working_dir: /bat-tiles
|
14 |
|
15 |
cloudflared:
|
16 |
image: cloudflare/cloudflared
|
|
|
20 |
- "TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN}"
|
21 |
restart: unless-stopped
|
22 |
depends_on:
|
23 |
+
- bat-tiles
|
|
|
24 |
command: tunnel run --protocol http2
|
25 |
|
26 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pages/2_Perform_Crop_Classification.py
CHANGED
@@ -81,23 +81,11 @@ def perform_inference_step():
|
|
81 |
st.success("Inference completed!")
|
82 |
|
83 |
# Add Satellite Imagery
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
fit_bounds=True,
|
90 |
-
vmin=vmin_vmax[selected_band][0],
|
91 |
-
vmax=vmin_vmax[selected_band][1],
|
92 |
-
)
|
93 |
-
else:
|
94 |
-
m.add_cog_layer(
|
95 |
-
url=os.environ.get("COG_URL"),
|
96 |
-
name="Sentinel-2 Satellite Imagery",
|
97 |
-
titiler_endpoint=os.environ.get("TITILER_ENDPOINT"),
|
98 |
-
bands=selected_bands,
|
99 |
-
rescale=f"{vmin_vmax[selected_band][0]},{vmin_vmax[selected_band][1]}"
|
100 |
-
)
|
101 |
|
102 |
# Show the POI on the map
|
103 |
poi_icon = Icon(color="green", prefix="fa", icon="crosshairs")
|
|
|
81 |
st.success("Inference completed!")
|
82 |
|
83 |
# Add Satellite Imagery
|
84 |
+
m.add_tile_layer(
|
85 |
+
url=os.environ.get("TILE_LAYER_URL"),
|
86 |
+
name="Sentinel-2 Satellite Imagery",
|
87 |
+
attribution="Copernicus Sentinel data 2019 / ESA",
|
88 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
# Show the POI on the map
|
91 |
poi_icon = Icon(color="green", prefix="fa", icon="crosshairs")
|