Mercurial Hosting > traffic-intelligence
diff trafficintelligence/moving.py @ 1240:bb14f919d1cb
cleaned use of centile (np only) and added info in classify-objects
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 05 Feb 2024 14:14:14 -0500 |
parents | d5695e0b59d9 |
children | ab4c72b9475c |
line wrap: on
line diff
--- a/trafficintelligence/moving.py Fri Oct 06 17:02:32 2023 -0400 +++ b/trafficintelligence/moving.py Mon Feb 05 14:14:14 2024 -0500 @@ -4,9 +4,8 @@ import copy from math import sqrt, atan2, cos, sin -from numpy import median, mean, array, arange, zeros, ones, hypot, NaN, std, floor, ceil, float32, argwhere, minimum, issubdtype, integer as npinteger +from numpy import median, mean, array, arange, zeros, ones, hypot, NaN, std, floor, ceil, float32, argwhere, minimum, issubdtype, integer as npinteger, percentile from matplotlib.pyplot import plot, text, arrow -from scipy.stats import scoreatpercentile from scipy.spatial.distance import cdist from scipy.signal import savgol_filter @@ -1850,7 +1849,7 @@ def speedDiagnostics(self, framerate = 1., display = False, nInstantsIgnoredAtEnds=0): speeds = framerate*self.getSpeeds(nInstantsIgnoredAtEnds) coef = utils.linearRegression(list(range(len(speeds))), speeds) - print('min/5th perc speed: {} / {}\nspeed diff: {}\nspeed stdev: {}\nregression: {}'.format(min(speeds), scoreatpercentile(speeds, 5), speeds[-2]-speeds[1], std(speeds), coef[0])) + print('min/5th perc speed: {} / {}\nspeed diff: {}\nspeed stdev: {}\nregression: {}'.format(min(speeds), percentile(speeds, 5), speeds[-2]-speeds[1], std(speeds), coef[0])) if display: from matplotlib.pyplot import figure, axis figure(1)