Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why “get_binimg” Donot crop and resize #46

Open
wuzuowuyou opened this issue Jul 28, 2023 · 1 comment
Open

why “get_binimg” Donot crop and resize #46

wuzuowuyou opened this issue Jul 28, 2023 · 1 comment

Comments

@wuzuowuyou
Copy link

Randomly crop and resize image data, why get_binimg Donot crop and resize

https://github.com/nv-tlabs/lift-splat-shoot/blob/d74598cb51101e2143097ab270726a561f81f8fd/src/data.py#L171C19-L171C19

def get_binimg(self, rec):
       egopose = self.nusc.get('ego_pose',
                               self.nusc.get('sample_data', rec['data']['LIDAR_TOP'])['ego_pose_token'])
       trans = -np.array(egopose['translation'])
       rot = Quaternion(egopose['rotation']).inverse
       img = np.zeros((self.nx[0], self.nx[1]))
       for tok in rec['anns']:
           inst = self.nusc.get('sample_annotation', tok)
           # add category for lyft
           if not inst['category_name'].split('.')[0] == 'vehicle':
               continue
           box = Box(inst['translation'], inst['size'], Quaternion(inst['rotation']))
           box.translate(trans)
           box.rotate(rot)

           pts = box.bottom_corners()[:2].T
           pts = np.round(
               (pts - self.bx[:2] + self.dx[:2]/2.) / self.dx[:2]
               ).astype(np.int32)
           pts[:, [1, 0]] = pts[:, [0, 1]]
           cv2.fillPoly(img, [pts], 1.0)

       return torch.Tensor(img).unsqueeze(0)
@manueldiaz96
Copy link

Because this is the BEV representation, not a camera image. So it represents the space around the vehicle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants