From 83267dddabd4a3d6dd275caa7f5f87185e068989 Mon Sep 17 00:00:00 2001 From: yongchao1 <297389370@qq.com> Date: Tue, 20 Sep 2022 12:41:22 +0000 Subject: [PATCH] update TensorFlow/contrib/cv/monoculartotalcapture_ID0866_for_Tensorflow/training_e2e_PAF.py. Signed-off-by: yongchao1 <297389370@qq.com> --- .../training_e2e_PAF.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TensorFlow/contrib/cv/monoculartotalcapture_ID0866_for_Tensorflow/training_e2e_PAF.py b/TensorFlow/contrib/cv/monoculartotalcapture_ID0866_for_Tensorflow/training_e2e_PAF.py index dc31bffcb..a65a8b83e 100644 --- a/TensorFlow/contrib/cv/monoculartotalcapture_ID0866_for_Tensorflow/training_e2e_PAF.py +++ b/TensorFlow/contrib/cv/monoculartotalcapture_ID0866_for_Tensorflow/training_e2e_PAF.py @@ -121,7 +121,9 @@ with tf.Graph().as_default(), tf.device('/cpu:0'): for ip, pred_PAF in enumerate(predicted_PAFs): resized_PAF = tf.image.resize_images(pred_PAF, (s[1], s[2]), method=tf.image.ResizeMethod.BICUBIC) channelWisePAF = tf.reshape(resized_PAF, [s[0], s[1], s[2], -1, 3]) - PAF_x2y2 = tf.sqrt(tf.reduce_sum(tf.square(channelWisePAF[:, :, :, :, 0:2]), axis=4)) + 1e-6 + #PAF_x2y2 = tf.sqrt(tf.reduce_sum(tf.square(channelWisePAF[:, :, :, :, 0:2]), axis=4)) + 1e-6 + a = tf.reduce_sum(tf.square(channelWisePAF[:, :, :, :, 0:2]), axis=4) + PAF_x2y2 = tf.sqrt(tf.maximum(a, 1.18e-38)) + 1e-6 PAF_normed_x = channelWisePAF[:, :, :, :, 0] / PAF_x2y2 PAF_normed_y = channelWisePAF[:, :, :, :, 1] / PAF_x2y2 PAF_normed_z = tf.zeros(PAF_normed_x.get_shape(), dtype=tf.float32) -- Gitee