Compare commits
No commits in common. "1aff04d4448f547574a74dce576c5bc194be9c77" and "49c5e66f1d7135abb81b040d38d73289c9d04092" have entirely different histories.
1aff04d444
...
49c5e66f1d
6 changed files with 34 additions and 28 deletions
|
@ -5,9 +5,9 @@
|
||||||
"learning_rate": 0.01,
|
"learning_rate": 0.01,
|
||||||
"min_learning_rate": 1e-05,
|
"min_learning_rate": 1e-05,
|
||||||
"learning_decay_rate": 0.9999,
|
"learning_decay_rate": 0.9999,
|
||||||
"prediction_horizon": 30,
|
"prediction_horizon": 50,
|
||||||
"minimum_history_length": 5,
|
"minimum_history_length": 10,
|
||||||
"maximum_history_length": 50,
|
"maximum_history_length": 80,
|
||||||
"map_encoder": {
|
"map_encoder": {
|
||||||
"PEDESTRIAN": {
|
"PEDESTRIAN": {
|
||||||
"heading_state_index": [2, 3],
|
"heading_state_index": [2, 3],
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
"dynamic": {
|
"dynamic": {
|
||||||
"PEDESTRIAN": {
|
"PEDESTRIAN": {
|
||||||
"name": "SingleIntegrator",
|
"name": "SingleIntegrator",
|
||||||
"distribution": true,
|
"distribution": false,
|
||||||
"limits": {}
|
"limits": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
10
poetry.lock
generated
10
poetry.lock
generated
|
@ -3692,7 +3692,7 @@ description = "This repository contains the code for Trajectron++: Dynamically-F
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = "^3.9,<3.12"
|
python-versions = "^3.9,<3.12"
|
||||||
files = []
|
files = []
|
||||||
develop = true
|
develop = false
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
dill = "^0.3.7"
|
dill = "^0.3.7"
|
||||||
|
@ -3719,8 +3719,10 @@ torch = [
|
||||||
tqdm = "^4.65.0"
|
tqdm = "^4.65.0"
|
||||||
|
|
||||||
[package.source]
|
[package.source]
|
||||||
type = "directory"
|
type = "git"
|
||||||
url = "../Trajectron-plus-plus"
|
url = "https://git.rubenvandeven.com/security_vision/Trajectron-plus-plus/"
|
||||||
|
reference = "HEAD"
|
||||||
|
resolved_reference = "4e883511d31c96f0a894afc714fed05e322cea5b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tsmoothie"
|
name = "tsmoothie"
|
||||||
|
@ -3927,4 +3929,4 @@ watchdog = ["watchdog (>=2.3)"]
|
||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "2.0"
|
lock-version = "2.0"
|
||||||
python-versions = "^3.10,<3.12,"
|
python-versions = "^3.10,<3.12,"
|
||||||
content-hash = "716919f29853fc36b09594af35aa8ca09d4d3ceb7ad9cf54a85f4042569ecf1c"
|
content-hash = "51023fede550e6a8066ed1689cfedfa01346d994e0dea773476609508dc9ee8b"
|
||||||
|
|
|
@ -16,8 +16,8 @@ rewrite_tracks = "trap.tools:rewrite_raw_track_files"
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.10,<3.12,"
|
python = "^3.10,<3.12,"
|
||||||
|
|
||||||
trajectron-plus-plus = { path = "../Trajectron-plus-plus/", develop = true }
|
#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 = { git = "https://git.rubenvandeven.com/security_vision/Trajectron-plus-plus/" }
|
||||||
torch = [
|
torch = [
|
||||||
{ version="1.12.1" },
|
{ 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'" },
|
# { 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'" },
|
||||||
|
|
|
@ -145,7 +145,7 @@ def process_data(src_dir: Path, dst_dir: Path, name: str, smooth_tracks: bool, c
|
||||||
print(max_frame_nr)
|
print(max_frame_nr)
|
||||||
|
|
||||||
# separate call so cursor is kept during multiple loops
|
# separate call so cursor is kept during multiple loops
|
||||||
# seed(123)
|
seed(123)
|
||||||
shuffle(tracks)
|
shuffle(tracks)
|
||||||
|
|
||||||
dt1 = RollingAverage()
|
dt1 = RollingAverage()
|
||||||
|
|
|
@ -200,7 +200,7 @@ def transition_path_points(path: np.array, t: float):
|
||||||
# distance = cum_lenghts[-1] * t
|
# distance = cum_lenghts[-1] * t
|
||||||
# ts = np.concatenate((np.array([0.]), cum_lenghts / cum_lenghts[-1]))
|
# ts = np.concatenate((np.array([0.]), cum_lenghts / cum_lenghts[-1]))
|
||||||
# print(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))
|
ts = np.concatenate((np.array([0.]), cum_lenghts / DRAW_SPEED))
|
||||||
new_path = [path[0]]
|
new_path = [path[0]]
|
||||||
|
|
||||||
|
@ -235,7 +235,6 @@ def draw_track_predictions(img: cv2.Mat, track: Track, color_index: int, camera:
|
||||||
# if convert_points:
|
# if convert_points:
|
||||||
# current_point = convert_points([current_point])[0]
|
# current_point = convert_points([current_point])[0]
|
||||||
|
|
||||||
lines = []
|
|
||||||
for pred_i, pred in enumerate(track.predictions):
|
for pred_i, pred in enumerate(track.predictions):
|
||||||
pred_coords = pred #cv2.perspectiveTransform(np.array([pred]), inv_H)[0].tolist()
|
pred_coords = pred #cv2.perspectiveTransform(np.array([pred]), inv_H)[0].tolist()
|
||||||
# line_points = pred_coords
|
# 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 = bgr_colors[color_index % len(bgr_colors)]
|
||||||
color = tuple([int(c*opacity) for c in color])
|
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
|
for start, end in zip(line_points[:-1], line_points[1:]):
|
||||||
cv2.polylines(img, lines, False, color, 2, cv2.LINE_AA)
|
# for ci in range(0, len(pred_coords)):
|
||||||
# for start, end in zip(line_points[:-1], line_points[1:]):
|
# if ci == 0:
|
||||||
# cv2.line(img, start, end, color, 2, lineType=cv2.LINE_AA)
|
# # TODO)) prev point
|
||||||
# pass
|
# # continue
|
||||||
# # cv2.circle(img, end, 2, color, 1, lineType=cv2.LINE_AA)
|
# 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]):
|
def draw_trackjectron_history(img: cv2.Mat, track: Track, color_index: int, convert_points: Optional[Callable]):
|
||||||
if not track.predictor_history:
|
if not track.predictor_history:
|
||||||
|
@ -295,14 +302,11 @@ def draw_track_projected(img: cv2.Mat, track: Track, color_index: int, camera: C
|
||||||
point_color = bgr_colors[color_index % len(bgr_colors)]
|
point_color = bgr_colors[color_index % len(bgr_colors)]
|
||||||
cv2.circle(img, to_point(history[0]), 3, point_color, 2)
|
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):
|
for j in range(len(history)-1):
|
||||||
# a = history[j]
|
a = history[j]
|
||||||
b = history[j+1]
|
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)
|
cv2.circle(img, to_point(b), 3, point_color, 2)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -691,7 +691,7 @@ class Smoother:
|
||||||
else:
|
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"
|
# "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
|
# 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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue