Skip to content

Commit

Permalink
TFDetect dynamic anchor count assignment fix (#5668)
Browse files Browse the repository at this point in the history
* fix tf.py when anchors not equal to 3

* revert the isort fix

* update the fix to use anchor attribute available already
  • Loading branch information
nrupatunga authored Nov 16, 2021
1 parent e80a09b commit 0453b75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def call(self, inputs):
xy /= tf.constant([[self.imgsz[1], self.imgsz[0]]], dtype=tf.float32)
wh /= tf.constant([[self.imgsz[1], self.imgsz[0]]], dtype=tf.float32)
y = tf.concat([xy, wh, y[..., 4:]], -1)
z.append(tf.reshape(y, [-1, 3 * ny * nx, self.no]))
z.append(tf.reshape(y, [-1, self.na * ny * nx, self.no]))

return x if self.training else (tf.concat(z, 1), x)

Expand Down

0 comments on commit 0453b75

Please sign in to comment.