MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / __iter__

Method __iter__

data/recon_dataset.py:612–885  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

610 )
611
612 def __iter__(self):
613 data_paths_per_worker, worker_id = self.get_data_paths_per_worker()
614 if self.data_status is not None:
615 row_start_id = self.data_status[worker_id] + 1
616 else:
617 row_start_id = 0
618
619 #comment: btw this is for all datasets in same group.
620
621 print(
622 f"rank-{self.local_rank} worker-{worker_id} dataset-{self.dataset_name}: "
623 f"resuming data at row#{row_start_id}"
624 )
625
626 while True:
627 data_paths_per_worker_ = data_paths_per_worker[row_start_id:]
628
629 allow_retry_times = 50 #20
630 retry_time = 0
631 data_fail = False
632 error = None
633 pi3 = True
634 if pi3:
635 shuffle_seq_views = True
636
637 for row_idx, (data, image_dir) in enumerate(data_paths_per_worker_, start=row_start_id):
638
639 num_tokens = 0
640 dino_image_tensor_list = []
641 dino_thw = []
642 dino_images =[]
643 text_ids_list = []
644 sequence_plan = []
645
646 images = []
647 depths = []
648 cam_points = []
649 world_points = []
650 point_masks = []
651 extrinsics = []
652 intrinsics = []
653 # image_paths = []
654 view_infos = []
655 original_sizes = []
656 img_per_seq_list = []
657 img_per_seq = self.frame_num
658 # print('img_per_seq', img_per_seq)
659
660 if high_resolution_training:
661 aspect_ratio = self.random_aspect_ratio
662 else:
663 aspect_ratio = 1.0
664 target_image_shape = self.get_target_shape(aspect_ratio)
665 self.resolution = target_image_shape
666
667 try:
668 data_item = json.loads(data)
669 if 'meta' in data_item:

Callers

nothing calls this directly

Calls 7

get_target_shapeMethod · 0.95
resizeMethod · 0.80
openMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected