Skip to content

Commit

Permalink
Update targets.py
Browse files Browse the repository at this point in the history
vqdang#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
  • Loading branch information
sumanthdonapati authored Feb 2, 2023
1 parent 326f17e commit 69ddad1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/hovernet/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 69ddad1

Please sign in to comment.