fixed types
Code Quality Pipeline / Check Code (pull_request) Successful in 3m15s

This commit is contained in:
brian
2025-01-06 13:42:21 +00:00
parent 16ad2b80ee
commit aff0ae8fc6
16 changed files with 88 additions and 74 deletions
+4 -6
View File
@@ -2,7 +2,6 @@
import random
from minio import Minio
from PIL import Image
from torch import Tensor
from torch.utils.data import Dataset
@@ -16,7 +15,7 @@ from torchvision.transforms.functional import (
to_tensor,
)
from shared.datastore import get_image
from shared.datastore import Datastore
# resnet18 original normalization values
RESNET_NORMALIZE_MEAN = [0.485, 0.456, 0.406]
@@ -28,13 +27,13 @@ class VCDADataset(Dataset):
def __init__(
self,
minio_client: Minio,
datastore: Datastore,
data_name_list: list[str],
do_augment: bool = False,
random_annotations: bool = False,
):
super().__init__()
self.minio_client = minio_client
self.datastore = datastore
self.data_name_list = data_name_list
self.do_augment = do_augment
self.random_annotations = random_annotations
@@ -57,8 +56,7 @@ class VCDADataset(Dataset):
def __getitem__(self, idx):
# get image from database
object_name = self.data_name_list[idx]
image = get_image(
client=self.minio_client,
image = self.datastore.get_image(
object_name=object_name,
)
tensor = self.image_to_tensor(image)