robokudo.io.storage =================== .. py:module:: robokudo.io.storage Classes ------- .. autoapisummary:: robokudo.io.storage.Storage Module Contents --------------- .. py:class:: Storage(db_name) This class holds the main interface code between RoboKudo and the MongoDB database. The latter can be used to store perceived data and also CAS views that you have specified. Here we also handle the conversion between concrete, non-standard classes (o3d data, RK types) and the representation that MongoDB can store (mainly Dict). .. py:attribute:: BLACKLISTED_TYPES .. py:method:: is_blacklisted() Check if an object is of a blacklisted type. .. py:method:: instantiate_mongo_client() :staticmethod: .. py:class:: Reader(db_name) .. py:attribute:: db_reader .. py:method:: reset_cursor() .. py:method:: collection_has_frames() .. py:method:: cursor_has_frames() .. py:method:: get_next_frame() -> Optional[dict] .. py:class:: ListReader(db_name) Database Model class that reads all matching records into a list which is used to iterate over the data. This allows to easily combine the reading of DB records in conjunction with the way the CollectionReader is checking for new data. .. py:attribute:: db_reader .. py:attribute:: index :value: None .. py:attribute:: data :value: [] .. py:method:: reset_cursor() .. py:method:: cursor_has_frames() .. py:method:: get_next_frame() -> Optional[dict] .. py:attribute:: db_name .. py:attribute:: client .. py:attribute:: db .. py:method:: drop_database() .. py:method:: nd_array_to_numpy_binary(arr) :staticmethod: .. py:method:: numpy_binary_to_nd_array(bin) :staticmethod: .. py:method:: ros_cam_info_to_mongo(cam_info) :staticmethod: .. py:method:: ros_cam_info_from_mongo(mongo_cam_info) :staticmethod: .. py:method:: camera_intrinsic_to_mongo(camera_intrinsic: open3d.camera.PinholeCameraIntrinsic) -> Dict[str, Union[int, float]] :staticmethod: .. py:method:: camera_intrinsic_from_mongo(camera_intrinsic_dict: Dict[str, Union[int, float]]) -> open3d.camera.PinholeCameraIntrinsic :staticmethod: .. py:method:: rk_stamped_transform_to_mongo(stamped_transform) :staticmethod: .. py:method:: rk_stamped_transform_from_mongo(stamped_transform_dict) :staticmethod: .. py:attribute:: view_configuration .. py:method:: store_views_in_mongo(cas_dict: Dict) -> None Store the views present in cas.views. Please note that this method will change cas. So make a deepcopy if you want to leave your true CAS untouched! :param cas_dict: CAS as a dictionary to persist .. py:method:: load_views_from_mongo_in_cas(cas_document: Dict) -> None .. py:method:: load_annotations_from_mongo_in_cas(cas_document: Dict, cas: robokudo.cas.CAS) -> None Restore the annotations from the database and insert them into the CAS. If no (pickled) annotations are available, cas will be untouched. :param cas_document: A dict representing a frame of a CAS in the database :param cas: The 'robokudo.cas.CAS' instance where the annotations shall be inserted to .. py:method:: generate_dict_from_real_cas(cas: robokudo.cas.CAS) -> Dict Generate dict that we can put in mongo from CAS :param cas: Input CAS that should be used to create a dict-representation of it. :return: A dict with references to parts of the input CAS. .. py:method:: store_cas_dict(cas_dict: Dict)