NanoBanana for Geoscience
Вчера гулял по городу и пришла в голову идея: можно ли извлечь что-нибудь научно полезное из image-to-image моделей типа NanoBanana. Оказалось что очень даже.
Дал ей zero-shot промпт построить heatmap of grass damage (насколько сильно вытоптана трава в парке) и модель справилась на отлично!
Прикладываю сам промпт (навайбенный с GPT-5):
Grass Damage Heatmap — Overlay Only
Goal
Return the original aerial photo with a high-contrast damage heatmap drawn only on grass. No side-by-side, no crops, no extra files.
Input
/mnt/data/333064BC-C638-4C4E-A255-DA277B7CD2AC.jpeg
1) Preprocess (robust color)
• Gray-world white balance and local illumination normalization (shadow-robust).
• Bilateral filter to reduce noise while preserving edges.
2) Grass segmentation (tighter)
• Use RGB vegetation indices to drive the mask:
ExG = 2G − R − B, VARI = (G − R) / (G + R − B + 1e-6).
Keep pixels with (ExG > p60_exg OR VARI > p60_vari) AND HSV hue in [70°,150°] OR low-chroma yellow/olive under shadow normalization.
• Explicitly exclude: tree canopies + shadows, bare soil/paths, playgrounds, buildings/roads/cars.
• Morphology: close→open to fill small holes; remove speckles < 0.5 m².
3) Damage score (shadow-robust, multi-cue)
damage_raw = w1*(1 - norm(VARi))
+ w2*yellow_brownness // hue shift 15°–70°, low S
+ w3*thin/patchy texture // low local NDVI proxy & high LBP contrast
+ w4*exposed-soil likelihood
Use w1=0.4, w2=0.3, w3=0.2, w4=0.1. Clamp to [0,1].
Distance-from-path prior: don’t boost 1–2 m fringe unless the damaged region extends ≥3 m into turf.
4) Adaptive contrast (per-lawn)
• Split grass into connected polygons (“lawns”).
• For each polygon, percentile scale p5→0, p95→1 (clip).
• Hide scores < 0.30.
5) Overlay style (make hotspots pop)
• Colormap (no green): purple → orange → yellow/white (plasma-like).
0.30–0.49 = purple, 0.50–0.74 = orange, ≥0.75 = yellow/white.
• Opacity on grass: 0.85.
• Non-grass context: grayscale at 40–45% brightness.
• Contours at 0.50 and 0.75 (white, 1–2 px).
• High-confidence “bald spots” (≥0.85 and area ≥ 3 m²): add thin black outline.
6) Legend (compact)
• “Grass damage (≥30%)” bar with ticks at 30/50/75/100; place top-right, non-occluding.
7) Output
• One PNG at native resolution: original image + overlay.
⸻
Ultra-short drop-in
“Overlay only. Segment grass via ExG/VARI + HSV; exclude trees/paths/buildings; shadow-robust. Score damage from (1−VARI), yellow/brownness, patchy texture, soil; apply path-fringe guard. Per-lawn percentile remap (p5→0, p95→1); hide <0.30. Draw purple→orange→yellow/white heatmap at 0.85 opacity on grass; rest grayscale 45%. Add white contours at 0.50/0.75 and black outlines for ≥0.85 ‘bald spots’. Return one PNG.”
Кидайте свои идеи в комментарии!