who is ready for big model?

old-commit-hash: 144b37728f
commatwo_master
George Hotz 5 years ago
parent 8a23af0dce
commit 877dbc352a
  1. 14
      common/transformations/model.py
  2. 10
      tools/replay/sensorium.py

@ -44,24 +44,15 @@ medmodel_intrinsics = np.array(
# BIG model # 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_YUV_SIZE = (BIGMODEL_INPUT_SIZE[0], BIGMODEL_INPUT_SIZE[1] * 3 // 2)
bigmodel_zoom = 1. bigmodel_zoom = 1.
bigmodel_intrinsics = np.array( bigmodel_intrinsics = np.array(
[[ eon_focal_length / bigmodel_zoom, 0. , 0.5 * BIGMODEL_INPUT_SIZE[0]], [[ 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.]]) [ 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, model_frame_from_road_frame = np.dot(model_intrinsics,
get_view_frame_from_road_frame(0, 0, 0, model_height)) 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)) 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)) 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' # 'camera from model camera'
def get_model_height_transform(camera_frame_from_road_frame, height): def get_model_height_transform(camera_frame_from_road_frame, height):

@ -2,14 +2,20 @@
# Question: Can a human drive from this data? # Question: Can a human drive from this data?
import os
import cv2 import cv2
import numpy as np import numpy as np
import cereal.messaging as messaging import cereal.messaging as messaging
from common.window import Window 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.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 from tools.replay.lib.ui_helpers import CalibrationTransformsForWarpMatrix
if __name__ == "__main__": if __name__ == "__main__":

Loading…
Cancel
Save