From 877dbc352aec630101ff865f3d272772c29f60f4 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Tue, 21 Apr 2020 20:23:49 -0700 Subject: [PATCH] who is ready for big model? old-commit-hash: 144b37728f24e20a9429b7ffa140d226de147bec --- common/transformations/model.py | 14 +++----------- tools/replay/sensorium.py | 10 ++++++++-- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/common/transformations/model.py b/common/transformations/model.py index c13cc7e387..c47c9e987f 100644 --- a/common/transformations/model.py +++ b/common/transformations/model.py @@ -44,24 +44,15 @@ medmodel_intrinsics = np.array( # BIG model -BIGMODEL_INPUT_SIZE = (864, 288) +BIGMODEL_INPUT_SIZE = (1024, 512) BIGMODEL_YUV_SIZE = (BIGMODEL_INPUT_SIZE[0], BIGMODEL_INPUT_SIZE[1] * 3 // 2) bigmodel_zoom = 1. bigmodel_intrinsics = np.array( [[ eon_focal_length / bigmodel_zoom, 0. , 0.5 * BIGMODEL_INPUT_SIZE[0]], - [ 0. , eon_focal_length / bigmodel_zoom, 0.2 * BIGMODEL_INPUT_SIZE[1]], + [ 0. , eon_focal_length / bigmodel_zoom, 256+MEDMODEL_CY], [ 0. , 0. , 1.]]) - -bigmodel_border = np.array([ - [0,0,1], - [BIGMODEL_INPUT_SIZE[0], 0, 1], - [BIGMODEL_INPUT_SIZE[0], BIGMODEL_INPUT_SIZE[1], 1], - [0, BIGMODEL_INPUT_SIZE[1], 1], -]) - - model_frame_from_road_frame = np.dot(model_intrinsics, get_view_frame_from_road_frame(0, 0, 0, model_height)) @@ -72,6 +63,7 @@ medmodel_frame_from_road_frame = np.dot(medmodel_intrinsics, get_view_frame_from_road_frame(0, 0, 0, model_height)) model_frame_from_bigmodel_frame = np.dot(model_intrinsics, np.linalg.inv(bigmodel_intrinsics)) +medmodel_frame_from_bigmodel_frame = np.dot(medmodel_intrinsics, np.linalg.inv(bigmodel_intrinsics)) # 'camera from model camera' def get_model_height_transform(camera_frame_from_road_frame, height): diff --git a/tools/replay/sensorium.py b/tools/replay/sensorium.py index 99c06a1d3b..b85d6ef8c0 100755 --- a/tools/replay/sensorium.py +++ b/tools/replay/sensorium.py @@ -2,14 +2,20 @@ # Question: Can a human drive from this data? +import os import cv2 import numpy as np import cereal.messaging as messaging from common.window import Window -from common.transformations.model import MEDMODEL_INPUT_SIZE +if os.getenv("BIG") is not None: + from common.transformations.model import BIGMODEL_INPUT_SIZE as MEDMODEL_INPUT_SIZE + from common.transformations.model import get_camera_frame_from_bigmodel_frame as get_camera_frame_from_medmodel_frame +else: + from common.transformations.model import MEDMODEL_INPUT_SIZE + from common.transformations.model import get_camera_frame_from_medmodel_frame + from common.transformations.camera import FULL_FRAME_SIZE, eon_intrinsics -from common.transformations.model import get_camera_frame_from_medmodel_frame from tools.replay.lib.ui_helpers import CalibrationTransformsForWarpMatrix if __name__ == "__main__":