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

Add Python binding to another overload of segNet::Mask #476

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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