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

Run on GPU? #113

Open
mj-raihan opened this issue Dec 15, 2023 · 0 comments
Open

Run on GPU? #113

mj-raihan opened this issue Dec 15, 2023 · 0 comments

Comments

@mj-raihan
Copy link

When I run the code, it's running on my laptop's built-in GPU, thus giving only 5 FPS. How can I run it on my laptops dedicated GPU.

laptop config:
dell Inspiron 3501
i5 12th gen
24GB RAM
GPU: mx330

The code is given below.
def example_BodyTrackingColorCamera():
# Initialize the library, if the library is not found, add the library path as argument
pykinect.initialize_libraries(track_body=True)

# Modify camera configuration
device_config = pykinect.default_configuration
device_config.color_resolution = pykinect.K4A_COLOR_RESOLUTION_1080P
device_config.depth_mode = pykinect.K4A_DEPTH_MODE_WFOV_2X2BINNED
#print(device_config)

# Start device
device = pykinect.start_device(config=device_config)

# Start body tracker
bodyTracker = pykinect.start_body_tracker()

cv2.namedWindow('Color image with skeleton',cv2.WINDOW_NORMAL)
while True:
	
	# Get capture
	capture = device.update()

	# Get body tracker frame
	body_frame = bodyTracker.update()

	# Get the color image
	ret, color_image = capture.get_color_image()

	if not ret:
		continue

	# Draw the skeletons into the color image
	color_skeleton = body_frame.draw_bodies(color_image, pykinect.K4A_CALIBRATION_TYPE_COLOR)

	# Overlay body segmentation on depth image
	cv2.imshow('Color image with skeleton',color_skeleton)	

	# Press q key to stop
	if cv2.waitKey(1) == ord('q'):  
		break

example_BodyTrackingColorCamera()

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

1 participant