Tim77777767 commited on
Commit
c620883
·
1 Parent(s): e4634c2

Anpassungen für HF

Browse files
Files changed (3) hide show
  1. config.json +20 -53
  2. model.safetensors +0 -3
  3. modeling_my_segformer.py +0 -5
config.json CHANGED
@@ -1,57 +1,24 @@
1
  {
2
- "architectures": [
3
- "MySegformerForSemanticSegmentation"
4
- ],
5
- "attn_drop_rate": 0.0,
6
- "drop_path_rate": 0.0,
7
- "drop_rate": 0.0,
8
- "embed_dims": [
9
- 64,
10
- 128,
11
- 320,
12
- 512
13
- ],
14
- "mlp_ratio": 4,
15
- "model_type": "my_segformer",
16
- "num_classes": 19,
17
- "num_heads": [
18
- 1,
19
- 2,
20
- 4,
21
- 8
22
- ],
23
- "num_layers": [
24
- 3,
25
- 4,
26
- 6,
27
- 3
28
- ],
29
  "num_stages": 4,
30
- "out_indices": [
31
- 0,
32
- 1,
33
- 2,
34
- 3
35
- ],
36
- "patch_sizes": [
37
- 7,
38
- 3,
39
- 3,
40
- 3
41
- ],
42
  "qkv_bias": true,
43
- "sr_ratios": [
44
- 8,
45
- 4,
46
- 2,
47
- 1
48
- ],
49
- "strides": [
50
- 4,
51
- 2,
52
- 2,
53
- 2
54
- ],
55
- "torch_dtype": "float32",
56
- "transformers_version": "4.55.0"
57
  }
 
1
  {
2
+ "in_channels": 3,
3
+ "embed_dims": [32, 64, 160, 256],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  "num_stages": 4,
5
+ "num_layers": [2, 2, 2, 2],
6
+ "num_heads": [1, 2, 5, 8],
7
+ "patch_sizes": [7, 3, 3, 3],
8
+ "sr_ratios": [8, 4, 2, 1],
9
+ "out_indices": [0, 1, 2, 3],
10
+ "mlp_ratio": 4,
 
 
 
 
 
 
11
  "qkv_bias": true,
12
+ "drop_rate": 0.0,
13
+ "attn_drop_rate": 0.0,
14
+ "drop_path_rate": 0.1,
15
+ "decode_head": {
16
+ "in_channels": [32, 64, 160, 256],
17
+ "in_index": [0, 1, 2, 3],
18
+ "channels": 256,
19
+ "dropout_ratio": 0.1,
20
+ "out_channels": 19,
21
+ "align_corners": false,
22
+ "interpolate_mode": "bilinear"
23
+ }
 
 
24
  }
model.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:818e1b51093355a5915fd844e68edc7af583b2a397272c84e6e12a670896bc23
3
- size 98934820
 
 
 
 
modeling_my_segformer.py CHANGED
@@ -26,11 +26,6 @@ class SegformerHead(nn.Module):
26
  self.align_corners = align_corners
27
  self.interpolate_mode = interpolate_mode
28
 
29
- print(f"in_channels: {self.in_channels}, type: {type(self.in_channels)}")
30
- print(f"in_index: {self.in_index}, type: {type(self.in_index)}")
31
- print(f"len(in_channels): {len(self.in_channels) if hasattr(self.in_channels, '__len__') else 'no len'}")
32
- print(f"len(in_index): {len(self.in_index) if hasattr(self.in_index, '__len__') else 'no len'}")
33
-
34
  self.act_cfg = dict(type='ReLU')
35
  self.conv_seg = nn.Conv2d(channels, out_channels, kernel_size=1)
36
  self.dropout = nn.Dropout2d(dropout_ratio) if dropout_ratio > 0 else None
 
26
  self.align_corners = align_corners
27
  self.interpolate_mode = interpolate_mode
28
 
 
 
 
 
 
29
  self.act_cfg = dict(type='ReLU')
30
  self.conv_seg = nn.Conv2d(channels, out_channels, kernel_size=1)
31
  self.dropout = nn.Dropout2d(dropout_ratio) if dropout_ratio > 0 else None