Fix naming in dataset.py

This commit is contained in:
henryruhs
2025-02-24 09:25:28 +01:00
parent 84be7d1ffb
commit 18a2531b54
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -15,8 +15,8 @@ class DynamicDataset(Dataset[Tensor]):
self.transforms = self.compose_transforms()
def __getitem__(self, index : int) -> Batch:
image_path = random.choice(self.file_paths)
vision_frame = cv2.imread(image_path)
file_path = random.choice(self.file_paths)
vision_frame = cv2.imread(file_path)
return self.transforms(vision_frame)
def __len__(self) -> int:
+3 -3
View File
@@ -16,12 +16,12 @@ class DynamicDataset(Dataset[Tensor]):
self.batch_ratio = batch_ratio
def __getitem__(self, index : int) -> Batch:
source_image_path = self.file_paths[index]
file_path = self.file_paths[index]
if random.random() < self.batch_ratio:
return self.prepare_equal_batch(source_image_path)
return self.prepare_equal_batch(file_path)
return self.prepare_different_batch(source_image_path)
return self.prepare_different_batch(file_path)
def __len__(self) -> int:
return len(self.file_paths)