beaunix commited on
Commit
ab56100
·
verified ·
1 Parent(s): 6397816

Update README FILE

Browse files
Files changed (1) hide show
  1. README.md +45 -9
README.md CHANGED
@@ -1,15 +1,51 @@
1
  ---
2
- title: River Segmentation
3
- emoji: 📚
4
- colorFrom: yellow
5
- colorTo: gray
6
  sdk: gradio
7
- sdk_version: 6.22.0
8
- python_version: '3.12'
9
  app_file: app.py
10
  pinned: false
11
- license: cc-by-nc-4.0
12
- short_description: Water Body Mask Segmentation - SegFormer-B2
13
  ---
14
 
15
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: Aegis-River-Segmentation
3
+ colorFrom: blue
4
+ colorTo: green
 
5
  sdk: gradio
6
+ sdk_version: 5.23.3
 
7
  app_file: app.py
8
  pinned: false
9
+ license: cc-by-nc-nd-4.0
 
10
  ---
11
 
12
+ # Aegis-River-Segmentation
13
+
14
+ Water body segmentation from river/waterway images using SegFormer-B2. This
15
+ Space loads the trained checkpoint from
16
+ [`beaunix/river-segmentation`](https://huggingface.co/beaunix/river-segmentation)
17
+ and runs it on ZeroGPU.
18
+
19
+ ## How it works
20
+
21
+ 1. The underlying model was trained as a 7-class semantic segmentation model
22
+ (background, water, sky, vegetation, building, vehicle, person) on a
23
+ combined RIWA + Parepare flood dataset.
24
+ 2. In practice, only the **water** class is reliable; the other 6 classes
25
+ are not used. This Space collapses the output to a binary mask:
26
+ water vs. everything else (rendered as black).
27
+ 3. The uploaded image is processed by `SegformerImageProcessor` (resize to
28
+ 512x512, ImageNet-style normalization), run through the model, and the
29
+ logits are upsampled back to the original image resolution before
30
+ thresholding.
31
+ 4. The report shows the original image, the binary water mask, an overlay,
32
+ and the water coverage ratio.
33
+
34
+ ## Important: dependency pinning
35
+
36
+ This Space requires **`transformers==4.45.2`** specifically. A later
37
+ `transformers` release renamed an internal SegFormer decode_head submodule
38
+ (`decode_head.linear_projections` -> `decode_head.linear_c`), which silently
39
+ breaks the correspondence between this checkpoint's saved keys and the
40
+ model architecture on a mismatched version. Do not upgrade `transformers`.
41
+
42
+ ## Notes
43
+
44
+ - Input is a single image (drag and drop), not a video.
45
+ - The 7-class architecture is preserved internally (required to load the
46
+ checkpoint correctly), but only the water class is surfaced to the user.
47
+
48
+ ## License
49
+
50
+ CC BY-NC-ND 4.0 (Attribution - NonCommercial - NoDerivatives).
51
+ See https://creativecommons.org/licenses/by-nc-nd/4.0/