You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gesture_rec/camera/factory.py

12 lines
359 B
Python

from .web_camera import WebCamera
from .oak_camera import OakCamera
def create_camera(camera_type='web', **kwargs):
if camera_type == 'web':
return WebCamera(**kwargs)
elif camera_type == 'oak':
kwargs.pop('camera_id', None)
return OakCamera(**kwargs)
else:
raise ValueError(f"Unknown camera type: {camera_type}")