shunk031 commited on
Commit
a349e5d
·
1 Parent(s): dbadb25

deploy: 9b091bed6e92624a368d339225a2373c3207ec09

Browse files
Files changed (1) hide show
  1. layout_alignment.py +3 -3
layout_alignment.py CHANGED
@@ -96,8 +96,8 @@ class LayoutAlignment(evaluate.Metric):
96
  X = np.abs(X).transpose(0, 2, 1, 3)
97
  X[~batch_mask] = 1.0
98
 
99
- # shape: (B, S)
100
- X = X.min(axis=-1).min(axis=-1)
101
  X[X == 1.0] = 0.0
102
  X = -np.log(1 - X)
103
 
@@ -141,7 +141,7 @@ class LayoutAlignment(evaluate.Metric):
141
  Y[batch_mask] = 1.0
142
 
143
  # shape: (B, 3, S, S) -> (B, S, S) -> (B, S)
144
- Y = np.abs(Y).min(axis=1).min(axis=2)
145
  Y[Y == 1.0] = 0.0
146
 
147
  # shape: (B, S) -> (B,)
 
96
  X = np.abs(X).transpose(0, 2, 1, 3)
97
  X[~batch_mask] = 1.0
98
 
99
+ # shape: (B, S, 6, S) -> (B, S)
100
+ X = X.min(axis=(2, 3))
101
  X[X == 1.0] = 0.0
102
  X = -np.log(1 - X)
103
 
 
141
  Y[batch_mask] = 1.0
142
 
143
  # shape: (B, 3, S, S) -> (B, S, S) -> (B, S)
144
+ Y = np.abs(Y).min(axis=(1, 2))
145
  Y[Y == 1.0] = 0.0
146
 
147
  # shape: (B, S) -> (B,)