Skip to content

Commit

Permalink
Replace tfds.core.ReadWritePath with epath.Path in the rest of movi f…
Browse files Browse the repository at this point in the history
…iles. (#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
  • Loading branch information
dilaragokay authored Jun 6, 2024
1 parent 0650741 commit 0c25305
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
10 changes: 5 additions & 5 deletions challenges/movi/movi_a.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
Expand Down Expand Up @@ -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".
Expand Down
12 changes: 6 additions & 6 deletions challenges/movi/movi_b.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
Expand Down Expand Up @@ -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".
Expand Down Expand Up @@ -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")
raise ValueError("invalid color hex string")
10 changes: 5 additions & 5 deletions challenges/movi/movi_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
Expand Down Expand Up @@ -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".
Expand Down
10 changes: 5 additions & 5 deletions challenges/movi/movi_d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
Expand Down Expand Up @@ -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".
Expand Down
10 changes: 5 additions & 5 deletions challenges/movi/movi_f.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
Expand Down Expand Up @@ -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".
Expand Down
10 changes: 5 additions & 5 deletions challenges/movi/panning_movi_e.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
Expand Down Expand Up @@ -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".
Expand Down

0 comments on commit 0c25305

Please sign in to comment.