Skip to content

basic_bot.test_helpers.camera_mock

Camera Objects

class Camera(BaseCamera)

This class implements a mock of BaseCamera interface using a set of static images. The images are loaded from the pet_images and not_pet_images test data. The mock camera will provide 50% pet images and 50% non pet image frames at 60 frames per second.

When running in BB_ENV=test, the vision service will use this mock camera in place of camera configured by BB_CAMERA_MODULE.

frames

@staticmethod
def frames() -> Generator[Union[bytes, np.ndarray], None, None]

Generator function that yields frames from the camera. Required by BaseCamera