Skip to content

Commit 120d055

Browse files
authored
Merge pull request #16 from Leoooo333/master-1
Add a functional argument to decide whether skip clip before final result.
2 parents e7bf731 + 7dd2916 commit 120d055

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

equilib/equi2pers/numpy.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ def run(
131131
z_down: bool,
132132
mode: str,
133133
override_func: Optional[Callable[[], Any]] = None,
134+
clip_output: bool = True,
134135
) -> np.ndarray:
135136
"""Run Equi2Pers
136137
@@ -224,7 +225,7 @@ def run(
224225

225226
out = (
226227
out.astype(equi_dtype)
227-
if equi_dtype == np.dtype(np.uint8)
228+
if equi_dtype == np.dtype(np.uint8) or not clip_output
228229
else np.clip(out, 0.0, 1.0)
229230
)
230231

equilib/equi2pers/torch.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def run(
117117
z_down: bool,
118118
mode: str,
119119
backend: str = "native",
120+
clip_output: bool = True,
120121
) -> torch.Tensor:
121122
"""Run Equi2Pers
122123
@@ -242,7 +243,7 @@ def run(
242243

243244
out = (
244245
out.type(equi_dtype)
245-
if equi_dtype == torch.uint8
246+
if equi_dtype == torch.uint8 or not clip_output
246247
else torch.clip(out, 0.0, 1.0)
247248
)
248249

0 commit comments

Comments
 (0)