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

Inference with custom data #22

Open
kaxapatel opened this issue Nov 17, 2022 · 1 comment
Open

Inference with custom data #22

kaxapatel opened this issue Nov 17, 2022 · 1 comment

Comments

@kaxapatel
Copy link

Hi. thank you for your last response. Now I am trying to deploy your model in one of my Jetson board with Velodyne sensor. First I want to try just feeding the single frame into the model. Can you suggest where can I change for input data in the test code. so I can easily generate predictions without giving data_path. My final goal is to have real-time segmentation with Lidar input. In more simplified way, input as a lidar raw data string and output as a predictions.

@edwardzhou130
Copy link
Owner

You will need to change the dataloader code:

def __getitem__(self, index):
raw_data = np.fromfile(self.im_idx[index], dtype=np.float32).reshape((-1, 4))
if self.imageset == 'test':
sem_data = np.expand_dims(np.zeros_like(raw_data[:,0],dtype=int),axis=1)
inst_data = np.expand_dims(np.zeros_like(raw_data[:,0],dtype=np.uint32),axis=1)
else:
annotated_data = np.fromfile(self.im_idx[index].replace('velodyne','labels')[:-3]+'label', dtype=np.uint32).reshape((-1,1))
sem_data = annotated_data & 0xFFFF #delete high 16 digits binary
sem_data = np.vectorize(self.learning_map.__getitem__)(sem_data)
inst_data = annotated_data
data_tuple = (raw_data[:,:3], sem_data.astype(np.uint8),inst_data)
if self.return_ref:
data_tuple += (raw_data[:,3],)
return data_tuple

It should work if you can feed the same type of raw data to data_tuple here.

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