fix: dilation crash

This commit is contained in:
Prohurtz 2023-11-24 18:08:49 -06:00
parent 5329911404
commit 1ecdbdc142

View File

@ -359,9 +359,10 @@ class EllipseBasedPupilDilation:
minp = float(self.maxval)
try:
eyedilation = (pupil_area - maxp) / (
minp - maxp
) # for whatever reason when input and maxp are too close it outputs high
if maxp != 0 and not (np.isnan(pupil_area) or np.isnan(maxp)):
eyedilation = (pupil_area - maxp) / (
minp - maxp
) # for whatever reason when input and maxp are too close it outputs high
except:
eyedilation = 0.5
eyedilation = 1 - eyedilation