# Path: sunds/typing.py



import abc
import copy
import tensorflow as tf
import tensorflow_datasets as tfds
from typing import Any, Dict, Optional
from sunds.typing import FeatureSpecsHint, Split, Tree, TreeDict  # pylint: disable=g-multiple-import
class FrameTask(Task):
  """Frame task.

  Frame task allow to easily create pipelines based on the frame dataset.
  It requires to define:

   * `frame_specs`: Which subset of the feature specs to read.
   * `pipeline`: Which pre-processing to apply to the `tf.data.Dataset` object.

  ```python
  ds = sunds.load('nerf_synthetic', split='train', task=sunds.tasks.Nerf())
  for ex in ds:
    ex['rays']
  ```

  The final pipeline is more or less equivalent to:

  ```python
  builder = tfds.builder('nerf_synthetic_frames')
  ds = builder.as_dataset(
      decoders=tfds.features.PartialDecoding(task.frame_specs),
  )
  ds = task.pipeline(ds)
  ```

  """

  def as_dataset(
      self,
      *,

# Path: sunds/typing.py



# Path: sunds/core/tasks.py
import abc
import copy
import tensorflow as tf
import tensorflow_datasets as tfds
from typing import Any, Dict, Optional
from sunds.typing import FeatureSpecsHint, Split, Tree, TreeDict  # pylint: disable=g-multiple-import

class FrameTask(Task):
  """Frame task.

  Frame task allow to easily create pipelines based on the frame dataset.
  It requires to define:

   * `frame_specs`: Which subset of the feature specs to read.
   * `pipeline`: Which pre-processing to apply to the `tf.data.Dataset` object.

  ```python
  ds = sunds.load('nerf_synthetic', split='train', task=sunds.tasks.Nerf())
  for ex in ds:
    ex['rays']
  ```

  The final pipeline is more or less equivalent to:

  ```python
  builder = tfds.builder('nerf_synthetic_frames')
  ds = builder.as_dataset(
      decoders=tfds.features.PartialDecoding(task.frame_specs),
  )
  ds = task.pipeline(ds)
  ```

  """

  def as_dataset(
      self,
      *,

      split: Tree[Split],