Compare commits

..

No commits in common. "1aff04d4448f547574a74dce576c5bc194be9c77" and "49c5e66f1d7135abb81b040d38d73289c9d04092" have entirely different histories.

6 changed files with 34 additions and 28 deletions

View file

@ -5,9 +5,9 @@
"learning_rate": 0.01,
"min_learning_rate": 1e-05,
"learning_decay_rate": 0.9999,
"prediction_horizon": 30,
"minimum_history_length": 5,
"maximum_history_length": 50,
"prediction_horizon": 50,
"minimum_history_length": 10,
"maximum_history_length": 80,
"map_encoder": {
"PEDESTRIAN": {
"heading_state_index": [2, 3],
@ -74,7 +74,7 @@
"dynamic": {
"PEDESTRIAN": {
"name": "SingleIntegrator",
"distribution": true,
"distribution": false,
"limits": {}
}
},

10
poetry.lock generated
View file

@ -3692,7 +3692,7 @@ description = "This repository contains the code for Trajectron++: Dynamically-F
optional = false
python-versions = "^3.9,<3.12"
files = []
develop = true
develop = false
[package.dependencies]
dill = "^0.3.7"
@ -3719,8 +3719,10 @@ torch = [
tqdm = "^4.65.0"
[package.source]
type = "directory"
url = "../Trajectron-plus-plus"
type = "git"
url = "https://git.rubenvandeven.com/security_vision/Trajectron-plus-plus/"
reference = "HEAD"
resolved_reference = "4e883511d31c96f0a894afc714fed05e322cea5b"
[[package]]
name = "tsmoothie"
@ -3927,4 +3929,4 @@ watchdog = ["watchdog (>=2.3)"]
[metadata]
lock-version = "2.0"
python-versions = "^3.10,<3.12,"
content-hash = "716919f29853fc36b09594af35aa8ca09d4d3ceb7ad9cf54a85f4042569ecf1c"
content-hash = "51023fede550e6a8066ed1689cfedfa01346d994e0dea773476609508dc9ee8b"

View file

@ -16,8 +16,8 @@ rewrite_tracks = "trap.tools:rewrite_raw_track_files"
[tool.poetry.dependencies]
python = "^3.10,<3.12,"
trajectron-plus-plus = { path = "../Trajectron-plus-plus/", develop = true }
#trajectron-plus-plus = { git = "https://git.rubenvandeven.com/security_vision/Trajectron-plus-plus/" }
#trajectron-plus-plus = { path = "../Trajectron-plus-plus/", develop = true }
trajectron-plus-plus = { git = "https://git.rubenvandeven.com/security_vision/Trajectron-plus-plus/" }
torch = [
{ version="1.12.1" },
# { url = "https://download.pytorch.org/whl/cu113/torch-1.12.1%2Bcu113-cp38-cp38-linux_x86_64.whl", markers = "python_version ~= '3.8' and sys_platform == 'linux'" },

View file

@ -145,7 +145,7 @@ def process_data(src_dir: Path, dst_dir: Path, name: str, smooth_tracks: bool, c
print(max_frame_nr)
# separate call so cursor is kept during multiple loops
# seed(123)
seed(123)
shuffle(tracks)
dt1 = RollingAverage()

View file

@ -200,7 +200,7 @@ def transition_path_points(path: np.array, t: float):
# distance = cum_lenghts[-1] * t
# ts = np.concatenate((np.array([0.]), cum_lenghts / cum_lenghts[-1]))
# print(cum_lenghts[-1])
DRAW_SPEED = 35 # fixed speed (independent of lenght) TODO)) make variable
DRAW_SPEED = 30 # fixed speed (independent of lenght) TODO)) make variable
ts = np.concatenate((np.array([0.]), cum_lenghts / DRAW_SPEED))
new_path = [path[0]]
@ -235,7 +235,6 @@ def draw_track_predictions(img: cv2.Mat, track: Track, color_index: int, camera:
# if convert_points:
# current_point = convert_points([current_point])[0]
lines = []
for pred_i, pred in enumerate(track.predictions):
pred_coords = pred #cv2.perspectiveTransform(np.array([pred]), inv_H)[0].tolist()
# line_points = pred_coords
@ -250,15 +249,23 @@ def draw_track_predictions(img: cv2.Mat, track: Track, color_index: int, camera:
color = bgr_colors[color_index % len(bgr_colors)]
color = tuple([int(c*opacity) for c in color])
line_points = line_points.reshape((-1,1,2))
lines.append(line_points)
# draw in a single pass
cv2.polylines(img, lines, False, color, 2, cv2.LINE_AA)
# for start, end in zip(line_points[:-1], line_points[1:]):
# cv2.line(img, start, end, color, 2, lineType=cv2.LINE_AA)
# pass
# # cv2.circle(img, end, 2, color, 1, lineType=cv2.LINE_AA)
for start, end in zip(line_points[:-1], line_points[1:]):
# for ci in range(0, len(pred_coords)):
# if ci == 0:
# # TODO)) prev point
# # continue
# start = [int(p) for p in current_point]
# # start = [int(p) for p in coords[-1]]
# # start = [0,0]?
# # print(start)
# else:
# start = [int(p) for p in pred_coords[ci-1]]
# end = [int(p) for p in pred_coords[ci]]
# print(np.rint(start),np.rint(end).tolist())
cv2.line(img, start, end, color, 2, lineType=cv2.LINE_AA)
pass
# cv2.circle(img, end, 2, color, 1, lineType=cv2.LINE_AA)
def draw_trackjectron_history(img: cv2.Mat, track: Track, color_index: int, convert_points: Optional[Callable]):
if not track.predictor_history:
@ -294,15 +301,12 @@ def draw_track_projected(img: cv2.Mat, track: Track, color_index: int, camera: C
point_color = bgr_colors[color_index % len(bgr_colors)]
cv2.circle(img, to_point(history[0]), 3, point_color, 2)
points = np.rint(history.reshape((-1,1,2))).astype(np.int32)
cv2.polylines(img, [points], False, point_color, 1)
for j in range(len(history)-1):
# a = history[j]
a = history[j]
b = history[j+1]
# cv2.line(img, to_point(a), to_point(b), point_color, 1)
cv2.line(img, to_point(a), to_point(b), point_color, 1)
cv2.circle(img, to_point(b), 3, point_color, 2)

View file

@ -691,7 +691,7 @@ class Smoother:
else:
# "Unlike Kalman filtering, which focuses on predicting and updating the current state using historical measurements, Kalman smoothing enhances the accuracy of past state values"
# see https://medium.com/@shahalkp1/kalman-smoothing-using-tsmoothie-0175260464e5
self.smoother = KalmanSmoother(component='level_trend', component_noise={'level':0.02, 'season': .01, 'trend':0.02},n_seasons = 2, copy=None)
self.smoother = KalmanSmoother(component='level_trend', component_noise={'level':0.03, 'season': .02, 'trend':0.04},n_seasons = 2, copy=None)