MCPcopy Index your code
hub / github.com/diffgram/diffgram / build_sensor_fusion_packet

Function build_sensor_fusion_packet

shared/export/export_generation.py:566–604  ·  view source on GitHub ↗

Generic method to generate a dict of information given a file

(
    file,
    session = None)

Source from the content-addressed store, hash-verified

564
565
566def build_sensor_fusion_packet(
567 file,
568 session = None):
569 """
570 Generic method to generate a dict of information given a file
571 """
572 point_cloud_dict = {}
573 point_cloud_file = file.get_child_point_cloud_file(session = session);
574 if point_cloud_file:
575 point_cloud_file.point_cloud.serialize(session = session)
576 point_cloud_dict = {
577 'original_filename': point_cloud_file.point_cloud.original_filename,
578 'image_signed_expiry': point_cloud_file.point_cloud.url_signed_expiry,
579 'image_signed_url': point_cloud_file.point_cloud.url_signed,
580 }
581
582 instance_dict_list = []
583
584
585 instance_list = Instance.list(
586 session = session,
587 file_id = file.id)
588
589 for instance in instance_list:
590 instance_dict_list.append(build_instance(instance, file))
591
592
593 return {
594 'file': {
595 'id': file.id,
596 'original_filename': file.original_filename,
597 'blob_url': point_cloud_file.point_cloud.url_signed if point_cloud_file.point_cloud else None,
598 'created_time': str(file.created_time),
599 'ann_is_complete': file.ann_is_complete,
600 'type': file.type
601 },
602 'point_cloud': point_cloud_dict,
603 'instance_list': instance_dict_list
604 }
605
606
607def build_relation(relation: Instance):

Callers 1

build_packetFunction · 0.85

Calls 4

build_instanceFunction · 0.85
serializeMethod · 0.45
listMethod · 0.45

Tested by

no test coverage detected