From 69ddad1535b54b4afe09cd6fd3a276b92663f3af Mon Sep 17 00:00:00 2001 From: Sumanth Donapati <74263775+sumanthdonapati@users.noreply.github.com> Date: Thu, 2 Feb 2023 15:20:10 +0530 Subject: [PATCH] Update targets.py #149 sometimes inst_com contains NaN values in it, idk why nan values are occuring in it. I am just replacing nan values with zero to not stop the training --- models/hovernet/targets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/hovernet/targets.py b/models/hovernet/targets.py index d9466d9b..855cfc43 100755 --- a/models/hovernet/targets.py +++ b/models/hovernet/targets.py @@ -56,7 +56,7 @@ def gen_instance_hv_map(ann, crop_shape): # instance center of mass, rounded to nearest pixel inst_com = list(measurements.center_of_mass(inst_map)) - + inst_com = [x if math.isnan(x) == False else 0 for x in inst_com] inst_com[0] = int(inst_com[0] + 0.5) inst_com[1] = int(inst_com[1] + 0.5)