Spaces:
Sleeping
Sleeping
Align Space docs with CPU demo
Browse files- README.md +4 -4
- app.py +14 -13
- requirements.txt +1 -1
README.md
CHANGED
|
@@ -6,9 +6,9 @@ colorTo: indigo
|
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 6.14.0
|
| 8 |
app_file: app.py
|
| 9 |
-
pinned:
|
| 10 |
license: apache-2.0
|
| 11 |
-
short_description:
|
| 12 |
tags:
|
| 13 |
- remote-sensing
|
| 14 |
- sentinel-1
|
|
@@ -31,8 +31,8 @@ tags:
|
|
| 31 |
|
| 32 |
# DarkVesselNet
|
| 33 |
|
| 34 |
-
Multi-modal remote sensing stack for dark vessel detection. Sentinel-1 SAR plus Sentinel-2 optical plus AIS
|
| 35 |
|
| 36 |
-
|
| 37 |
|
| 38 |
See the [GitHub repository](https://github.com/arunshar/darkvessel-stack) for the full pipeline, training recipes, and xView3-SAR leaderboard reproduction.
|
|
|
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 6.14.0
|
| 8 |
app_file: app.py
|
| 9 |
+
pinned: true
|
| 10 |
license: apache-2.0
|
| 11 |
+
short_description: CPU-safe dark-vessel reasoning demo for S1/S2/AIS fusion.
|
| 12 |
tags:
|
| 13 |
- remote-sensing
|
| 14 |
- sentinel-1
|
|
|
|
| 31 |
|
| 32 |
# DarkVesselNet
|
| 33 |
|
| 34 |
+
Multi-modal remote sensing stack for dark vessel detection. Sentinel-1 SAR plus Sentinel-2 optical plus AIS are fused through geospatial foundation-model backbones in the full repository, with physics-informed anomaly reasoning via TGARD and Pi-DPM.
|
| 35 |
|
| 36 |
+
This public Hugging Face Space is the CPU-safe demo path: pick an area of interest and the app generates shape-consistent synthetic Sentinel-1, Sentinel-2, and AIS tensors, then runs the same scoring trace used by the scaffold. It does not download live Planetary Computer scenes or MarineCadastre AIS on the free Space tier.
|
| 37 |
|
| 38 |
See the [GitHub repository](https://github.com/arunshar/darkvessel-stack) for the full pipeline, training recipes, and xView3-SAR leaderboard reproduction.
|
app.py
CHANGED
|
@@ -1,17 +1,14 @@
|
|
| 1 |
"""Gradio HF Space entry point for DarkVesselNet.
|
| 2 |
|
| 3 |
-
The Space
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
heads, joins to MarineCadastre AIS, and renders a Folium overlay of
|
| 8 |
-
candidate dark vessels with a reasoning trace per detection.
|
| 9 |
-
|
| 10 |
-
For HF CPU smoke we ship a stubbed backbone that returns shape-consistent
|
| 11 |
-
features without downloading 600M-parameter weights.
|
| 12 |
"""
|
| 13 |
from __future__ import annotations
|
| 14 |
|
|
|
|
|
|
|
| 15 |
import gradio as gr
|
| 16 |
import torch
|
| 17 |
|
|
@@ -28,7 +25,7 @@ AOIS = {
|
|
| 28 |
def run_pipeline(aoi: str) -> str:
|
| 29 |
if aoi not in AOIS:
|
| 30 |
return "Unknown AOI."
|
| 31 |
-
torch.manual_seed(
|
| 32 |
chip = torch.randn(1, 6, 224, 224)
|
| 33 |
ais = torch.randn(1, 12, 5)
|
| 34 |
optical_sar_energy = chip.square().mean()
|
|
@@ -37,16 +34,20 @@ def run_pipeline(aoi: str) -> str:
|
|
| 37 |
lat, lon = AOIS[aoi]
|
| 38 |
return (
|
| 39 |
f"AOI: {aoi} ({lat:.3f}, {lon:.3f})\n"
|
| 40 |
-
f"backbone: prithvi-2 (
|
| 41 |
f"dark vessel probability: {score:.3f}\n"
|
| 42 |
f"reasoning: TGARD gap score 0.42, Pi-DPM kinematic residual 0.18 m/s^2.\n"
|
| 43 |
-
f"sensor stack
|
| 44 |
)
|
| 45 |
|
| 46 |
|
| 47 |
def build_ui() -> gr.Blocks:
|
| 48 |
with gr.Blocks(title="DarkVesselNet") as demo:
|
| 49 |
-
gr.Markdown(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
aoi = gr.Dropdown(choices=list(AOIS), value="Gulf of Oman", label="Area of interest")
|
| 51 |
out = gr.Textbox(label="Pipeline output", lines=8)
|
| 52 |
btn = gr.Button("Run DarkVesselNet")
|
|
|
|
| 1 |
"""Gradio HF Space entry point for DarkVesselNet.
|
| 2 |
|
| 3 |
+
The public Space is a CPU-safe scaffold: it exposes the same AOIs and
|
| 4 |
+
reasoning trace as the full project, but uses deterministic synthetic
|
| 5 |
+
Sentinel-1/Sentinel-2/AIS tensors instead of live external downloads or
|
| 6 |
+
600M-parameter foundation-model weights.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
"""
|
| 8 |
from __future__ import annotations
|
| 9 |
|
| 10 |
+
import zlib
|
| 11 |
+
|
| 12 |
import gradio as gr
|
| 13 |
import torch
|
| 14 |
|
|
|
|
| 25 |
def run_pipeline(aoi: str) -> str:
|
| 26 |
if aoi not in AOIS:
|
| 27 |
return "Unknown AOI."
|
| 28 |
+
torch.manual_seed(zlib.crc32(aoi.encode("utf-8")) & 0xFFFF)
|
| 29 |
chip = torch.randn(1, 6, 224, 224)
|
| 30 |
ais = torch.randn(1, 12, 5)
|
| 31 |
optical_sar_energy = chip.square().mean()
|
|
|
|
| 34 |
lat, lon = AOIS[aoi]
|
| 35 |
return (
|
| 36 |
f"AOI: {aoi} ({lat:.3f}, {lon:.3f})\n"
|
| 37 |
+
f"backbone: prithvi-2 interface (CPU demo mode)\n"
|
| 38 |
f"dark vessel probability: {score:.3f}\n"
|
| 39 |
f"reasoning: TGARD gap score 0.42, Pi-DPM kinematic residual 0.18 m/s^2.\n"
|
| 40 |
+
f"sensor stack simulated: Sentinel-1 VV/VH GRD, Sentinel-2 L2A, AIS DMA feed.\n"
|
| 41 |
)
|
| 42 |
|
| 43 |
|
| 44 |
def build_ui() -> gr.Blocks:
|
| 45 |
with gr.Blocks(title="DarkVesselNet") as demo:
|
| 46 |
+
gr.Markdown(
|
| 47 |
+
"# DarkVesselNet\n"
|
| 48 |
+
"CPU-safe dark-vessel reasoning demo for S1/S2/AIS fusion. "
|
| 49 |
+
"The full repository contains the live data connectors and model-backed pipeline."
|
| 50 |
+
)
|
| 51 |
aoi = gr.Dropdown(choices=list(AOIS), value="Gulf of Oman", label="Area of interest")
|
| 52 |
out = gr.Textbox(label="Pipeline output", lines=8)
|
| 53 |
btn = gr.Button("Run DarkVesselNet")
|
requirements.txt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
torch>=2.3
|
| 2 |
-
gradio>=
|
| 3 |
audioop-lts>=0.2.0
|
|
|
|
| 1 |
torch>=2.3
|
| 2 |
+
gradio>=6.14.0
|
| 3 |
audioop-lts>=0.2.0
|