Files

Base File object

Attributes

  • id: int
  • path: str
  • url: str
  • blob_path: str
  • file_name: str
  • bucket_name: str
  • child_file_type: str
  • connection_id: int
  • media_type: str
  • job: Job
  • job_id: int
  • directory_id: int
  • instance_list: list
  • frame_packet_map: dict
  • assume_new_instances_machine_made: bool
  • convert_names_to_label_files: bool
  • video_split_duration: int

file.get_by_id()

file = project.file.get_by_id(id = id)
Get File object by known file id.

file.update()

Arguments include
instance_list For images
frame_packet_map For video

file = project.file.get_by_id(id = id)

file.update(frame_packet_map = frame_packet_map)

https://github.com/diffgram/diffgram/blob/master/sdk/diffgram/file/test_existing_instances.py#L130

file.copy()

dataset = project.directory.get(name='Default')
destination_dataset = project.directory.get(name='my destination dataset') 
file_to_copy = dataset.list_files()[0] 
copied_file = file.copy(destination_dir=destination)
print('ID of copied File: {}'.format(copied_file.id)

📘

Other file methods see Input docs