From 0c253051688d8b33b3de66dc080a489be107a7c7 Mon Sep 17 00:00:00 2001 From: Dilara Gokay Date: Thu, 6 Jun 2024 15:05:43 +0100 Subject: [PATCH] Replace tfds.core.ReadWritePath with epath.Path in the rest of movi files. (#328) * Replace tfds.core.ReadWritePath with epath.Path. * Update movi_a.py * Update movi_b.py * Update movi_c.py * Update movi_d.py * Update movi_f.py * Update panning_movi_e.py --- challenges/movi/movi_a.py | 10 +++++----- challenges/movi/movi_b.py | 12 ++++++------ challenges/movi/movi_c.py | 10 +++++----- challenges/movi/movi_d.py | 10 +++++----- challenges/movi/movi_f.py | 10 +++++----- challenges/movi/panning_movi_e.py | 10 +++++----- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/challenges/movi/movi_a.py b/challenges/movi/movi_a.py index c9ceb786..6d55e5c4 100644 --- a/challenges/movi/movi_a.py +++ b/challenges/movi/movi_a.py @@ -16,14 +16,14 @@ import dataclasses import json import logging +from typing import Dict, List, Union +from etils import epath import imageio import numpy as np import png - import tensorflow as tf import tensorflow_datasets.public_api as tfds -from typing import List, Dict, Union _DESCRIPTION = """ @@ -572,11 +572,11 @@ def is_complete_dir(video_dir, layers=DEFAULT_LAYERS): return True -PathLike = Union[str, tfds.core.ReadWritePath] +PathLike = Union[str, epath.Path] -def as_path(path: PathLike) -> tfds.core.ReadWritePath: - """Convert str or pathlike object to tfds.core.ReadWritePath. +def as_path(path: PathLike) -> epath.Path: + """Convert str or pathlike object to epath.Path. Instead of pathlib.Paths, we use the TFDS path because they transparently support paths to GCS buckets such as "gs://kubric-public/GSO". diff --git a/challenges/movi/movi_b.py b/challenges/movi/movi_b.py index ef3ddbab..70798def 100644 --- a/challenges/movi/movi_b.py +++ b/challenges/movi/movi_b.py @@ -16,14 +16,14 @@ import dataclasses import json import logging +from typing import List, Dict, Union +from etils import epath import imageio import numpy as np import png - import tensorflow as tf import tensorflow_datasets.public_api as tfds -from typing import List, Dict, Union _DESCRIPTION = """ @@ -573,11 +573,11 @@ def is_complete_dir(video_dir, layers=DEFAULT_LAYERS): return True -PathLike = Union[str, tfds.core.ReadWritePath] +PathLike = Union[str, epath.Path] -def as_path(path: PathLike) -> tfds.core.ReadWritePath: - """Convert str or pathlike object to tfds.core.ReadWritePath. +def as_path(path: PathLike) -> epath.Path: + """Convert str or pathlike object to epath.Path. Instead of pathlib.Paths, we use the TFDS path because they transparently support paths to GCS buckets such as "gs://kubric-public/GSO". @@ -656,4 +656,4 @@ def rgb_from_hexstr(hexstr: str): a = int(hexstr[6:8], 16) / 255.0 return r, g, b else: - raise ValueError("invalid color hex string") \ No newline at end of file + raise ValueError("invalid color hex string") diff --git a/challenges/movi/movi_c.py b/challenges/movi/movi_c.py index 3ca45bab..7cf85f11 100644 --- a/challenges/movi/movi_c.py +++ b/challenges/movi/movi_c.py @@ -16,14 +16,14 @@ import dataclasses import json import logging +from typing import List, Dict, Union +from etils import epath import imageio import numpy as np import png - import tensorflow as tf import tensorflow_datasets.public_api as tfds -from typing import List, Dict, Union _DESCRIPTION = """ @@ -567,11 +567,11 @@ def is_complete_dir(video_dir, layers=DEFAULT_LAYERS): return True -PathLike = Union[str, tfds.core.ReadWritePath] +PathLike = Union[str, epath.Path] -def as_path(path: PathLike) -> tfds.core.ReadWritePath: - """Convert str or pathlike object to tfds.core.ReadWritePath. +def as_path(path: PathLike) -> epath.Path: + """Convert str or pathlike object to epath.Path. Instead of pathlib.Paths, we use the TFDS path because they transparently support paths to GCS buckets such as "gs://kubric-public/GSO". diff --git a/challenges/movi/movi_d.py b/challenges/movi/movi_d.py index fc69c292..5d656268 100644 --- a/challenges/movi/movi_d.py +++ b/challenges/movi/movi_d.py @@ -16,14 +16,14 @@ import dataclasses import json import logging +from typing import List, Dict, Union +from etils import epath import imageio import numpy as np import png - import tensorflow as tf import tensorflow_datasets.public_api as tfds -from typing import List, Dict, Union _DESCRIPTION = """ @@ -572,11 +572,11 @@ def is_complete_dir(video_dir, layers=DEFAULT_LAYERS): return True -PathLike = Union[str, tfds.core.ReadWritePath] +PathLike = Union[str, epath.Path] -def as_path(path: PathLike) -> tfds.core.ReadWritePath: - """Convert str or pathlike object to tfds.core.ReadWritePath. +def as_path(path: PathLike) -> epath.Path: + """Convert str or pathlike object to epath.Path. Instead of pathlib.Paths, we use the TFDS path because they transparently support paths to GCS buckets such as "gs://kubric-public/GSO". diff --git a/challenges/movi/movi_f.py b/challenges/movi/movi_f.py index 103956cd..4b983612 100644 --- a/challenges/movi/movi_f.py +++ b/challenges/movi/movi_f.py @@ -16,14 +16,14 @@ import dataclasses import json import logging +from typing import List, Dict, Union +from etils import epath import imageio import numpy as np import png - import tensorflow as tf import tensorflow_datasets.public_api as tfds -from typing import List, Dict, Union _DESCRIPTION = """ @@ -587,11 +587,11 @@ def is_complete_dir(video_dir, layers=DEFAULT_LAYERS): return True -PathLike = Union[str, tfds.core.ReadWritePath] +PathLike = Union[str, epath.Path] -def as_path(path: PathLike) -> tfds.core.ReadWritePath: - """Convert str or pathlike object to tfds.core.ReadWritePath. +def as_path(path: PathLike) -> epath.Path: + """Convert str or pathlike object to epath.Path. Instead of pathlib.Paths, we use the TFDS path because they transparently support paths to GCS buckets such as "gs://kubric-public/GSO". diff --git a/challenges/movi/panning_movi_e.py b/challenges/movi/panning_movi_e.py index 78b28c83..08c190b8 100644 --- a/challenges/movi/panning_movi_e.py +++ b/challenges/movi/panning_movi_e.py @@ -16,14 +16,14 @@ import dataclasses import json import logging +from typing import List, Dict, Union +from etils import epath import imageio import numpy as np import png - import tensorflow as tf import tensorflow_datasets.public_api as tfds -from typing import List, Dict, Union _DESCRIPTION = """ @@ -560,11 +560,11 @@ def is_complete_dir(video_dir, layers=DEFAULT_LAYERS): return True -PathLike = Union[str, tfds.core.ReadWritePath] +PathLike = Union[str, epath.Path] -def as_path(path: PathLike) -> tfds.core.ReadWritePath: - """Convert str or pathlike object to tfds.core.ReadWritePath. +def as_path(path: PathLike) -> epath.Path: + """Convert str or pathlike object to epath.Path. Instead of pathlib.Paths, we use the TFDS path because they transparently support paths to GCS buckets such as "gs://kubric-public/GSO".