Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/sg 000 move image format to dataconfig #193

Merged
merged 10 commits into from
Sep 28, 2023
Prev Previous commit
fix
  • Loading branch information
Louis-Dupont committed Sep 28, 2023
commit 362b28cb0d33cd0401fd791285f869c6d2c6916b
4 changes: 2 additions & 2 deletions src/data_gradients/dataset_adapters/formatters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Tuple

import torch
from data_gradients.dataset_adapters.config.questions import Question
from data_gradients.dataset_adapters.config.questions import FixedOptionsQuestion


class BatchFormatter(ABC):
Expand All @@ -25,7 +25,7 @@ def format(self, images: torch.Tensor, labels: torch.Tensor) -> Tuple[torch.Tens
def get_n_image_channels(self, images: torch.Tensor) -> int:
"""Get the number of image channels in the batch. If not set yet, it will be asked to the user."""
if self._n_image_channels is None:
question = Question(
question = FixedOptionsQuestion(
question="Which dimension corresponds the image channel? ",
options={i: images.shape[i] for i in range(len(images.shape))},
)
Expand Down