Unverified 提交 0453b758 authored 作者: Nrupatunga's avatar Nrupatunga 提交者: GitHub

TFDetect dynamic anchor count assignment fix (#5668)

* fix tf.py when anchors not equal to 3 * revert the isort fix * update the fix to use anchor attribute available already
上级 e80a09bb
......@@ -233,7 +233,7 @@ class TFDetect(keras.layers.Layer):
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)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论