This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_dict(dictionary, ident='', braces=1): | |
""" Recursively prints nested dictionaries.""" | |
cached_dicts = [] | |
for key, value in dictionary.items(): | |
if isinstance(value, dict): | |
cached_dicts.append((key, value)) | |
else: | |
print(f'{ident}{key} = {value}') | |
for key, value in cached_dicts: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
import torch | |
def generate_corners3d(whl:torch.Tensor, ry:torch.Tensor=[0], pos:torch.Tensor=[0,0], depth:torch.Tensor=[0]) -> torch.Tensor: | |
""" | |
https://github.com/ZrrSkywalker/MonoDETR/blob/main/lib/datasets/kitti/kitti_utils.py | |
Generates a representation of 3D bounding box(es) as 8 corners in camera coordinates. |