PreviewBuffer
- class lib.training.preview_cv.PreviewBuffer
Bases:
objectA thread safe class for holding preview images
Attributes Summary
Truewhen new images have been loaded into the preview bufferMethods Summary
add_image(name, image)Add an image to the preview buffer in a thread safe way
Get the latest images from the preview buffer.
Attributes Documentation
- is_updated
Truewhen new images have been loaded into the preview buffer- Type:
bool
Methods Documentation
- add_image(name: str, image: np.ndarray) None
Add an image to the preview buffer in a thread safe way
- Parameters:
name (str)
image (np.ndarray)
- Return type:
None
- get_images() Generator[tuple[str, np.ndarray], None, None]
Get the latest images from the preview buffer. When iterator is exhausted clears the
updatedevent.- Yields:
name (str) – The name of the image
numpy.ndarray– The image in BGR format
- Return type:
Generator[tuple[str, np.ndarray], None, None]
- add_image(name: str, image: np.ndarray) None
Add an image to the preview buffer in a thread safe way
- Parameters:
name (str)
image (np.ndarray)
- Return type:
None
- get_images() Generator[tuple[str, np.ndarray], None, None]
Get the latest images from the preview buffer. When iterator is exhausted clears the
updatedevent.- Yields:
name (str) – The name of the image
numpy.ndarray– The image in BGR format
- Return type:
Generator[tuple[str, np.ndarray], None, None]
- property is_updated: bool
Truewhen new images have been loaded into the preview buffer- Type:
bool