# Path: sunds/core/tasks.py
# class Task(abc.ABC):
# class FrameTask(Task):
#   def initialize(
#       self,
#       *,
#       scene_builder: tfds.core.DatasetBuilder,
#       frame_builder: tfds.core.DatasetBuilder,
#   ) -> 'Task':
#   def as_dataset(self, **kwargs) -> tf.data.Dataset:
#   def full_scene_specs(self) -> tfds.features.FeaturesDict:
#   def full_frame_specs(self) -> tfds.features.FeaturesDict:
#   def as_dataset(
#       self,
#       *,
#       split: Tree[Split],
#       decoders: Optional[TreeDict[tfds.decode.Decoder]] = None,
#       pipeline_kwargs: Optional[Dict[str, Any]] = None,
#       **kwargs,
#   ) -> tf.data.Dataset:
#   def frame_specs(self) -> Optional[FeatureSpecsHint]:
#   def pipeline(self, ds: tf.data.Dataset) -> tf.data.Dataset:
# 
# Path: sunds/typing.py



import typing
import tensorflow as tf
import tensorflow_datasets as tfds
      import sunds  # pylint: disable=g-import-not-at-top
from typing import Callable, Optional, Union
from etils import epath
from sunds.core import tasks as tasks_lib
from sunds.typing import Split, Tree  # pylint: disable=g-multiple-import


class DatasetBuilder:
  """Wrapper around `tfds.core.DatasetBuilder`."""

  def __init__(
      self,
      *,
      scene_builder: LazyBuilder,
      frame_builder: LazyBuilder,
  ):
    """Constructor.

    Args:
      scene_builder: Dataset builder containing the scenes.
      frame_builder: Dataset builder containing the frames.
    """
    self._scene_builder = scene_builder
    self._frame_builder = frame_builder
    self._validate()

  def download_and_prepare(self, **kwargs):
    """Download and prepare the dataset."""
    # Is a no-op if the dataset has already been generated
    self.scene_builder.download_and_prepare(**kwargs)
    self.frame_builder.download_and_prepare(**kwargs)

  def as_dataset(
      self,
      *,

# Path: sunds/core/tasks.py
# class Task(abc.ABC):
# class FrameTask(Task):
#   def initialize(
#       self,
#       *,
#       scene_builder: tfds.core.DatasetBuilder,
#       frame_builder: tfds.core.DatasetBuilder,
#   ) -> 'Task':
#   def as_dataset(self, **kwargs) -> tf.data.Dataset:
#   def full_scene_specs(self) -> tfds.features.FeaturesDict:
#   def full_frame_specs(self) -> tfds.features.FeaturesDict:
#   def as_dataset(
#       self,
#       *,
#       split: Tree[Split],
#       decoders: Optional[TreeDict[tfds.decode.Decoder]] = None,
#       pipeline_kwargs: Optional[Dict[str, Any]] = None,
#       **kwargs,
#   ) -> tf.data.Dataset:
#   def frame_specs(self) -> Optional[FeatureSpecsHint]:
#   def pipeline(self, ds: tf.data.Dataset) -> tf.data.Dataset:
# 
# Path: sunds/typing.py



# Path: sunds/core/dataset_builder.py
import typing
import tensorflow as tf
import tensorflow_datasets as tfds
      import sunds  # pylint: disable=g-import-not-at-top
from typing import Callable, Optional, Union
from etils import epath
from sunds.core import tasks as tasks_lib
from sunds.typing import Split, Tree  # pylint: disable=g-multiple-import



class DatasetBuilder:
  """Wrapper around `tfds.core.DatasetBuilder`."""

  def __init__(
      self,
      *,
      scene_builder: LazyBuilder,
      frame_builder: LazyBuilder,
  ):
    """Constructor.

    Args:
      scene_builder: Dataset builder containing the scenes.
      frame_builder: Dataset builder containing the frames.
    """
    self._scene_builder = scene_builder
    self._frame_builder = frame_builder
    self._validate()

  def download_and_prepare(self, **kwargs):
    """Download and prepare the dataset."""
    # Is a no-op if the dataset has already been generated
    self.scene_builder.download_and_prepare(**kwargs)
    self.frame_builder.download_and_prepare(**kwargs)

  def as_dataset(
      self,
      *,

      split: Tree[Split],