Skip to content

Conversation

@hanzhi713
Copy link

@hanzhi713 hanzhi713 commented Jan 11, 2020

Addresses issue #473

  • Add binding to another overload of segNet::Mask
  • Use integer division in segnet-camera.py

Usage of the new python binding:

# classes is an uint8 array
classes = jetson.utils.cudaAllocMapped(width * height)
net.MaskClass(classes, width, height)
# cudaToNumpy assumes float32. Need to dividie output length by 4.
mask = jetson.utils.cudaToNumpy(classes, 1, width * height // 4, 1)[:, 0, 0]
# convert resulting float32 view to uint8 view
mask_np = mask.view('uint8').reshape(width, height)

@hanzhi713 hanzhi713 changed the title Add binding to another overload of segNet::Mask Add Python binding to another overload of segNet::Mask Jan 11, 2020
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

Successfully merging this pull request may close these issues.

1 participant