Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
98b6bee1
Unverified
Commit
98b6bee1
authored
Feb 09, 2024
by
Bingxin Ke
Committed by
GitHub
Feb 09, 2024
Browse files
[Community Pipeline][Bug Fix] marigold_depth_estimation: input image value range (#6787)
[FIX] IMPORTANT: rgb normalization
parent
ab711348
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
examples/community/marigold_depth_estimation.py
examples/community/marigold_depth_estimation.py
+2
-2
No files found.
examples/community/marigold_depth_estimation.py
View file @
98b6bee1
...
...
@@ -170,10 +170,10 @@ class MarigoldPipeline(DiffusionPipeline):
# Normalize rgb values
rgb
=
np
.
transpose
(
image
,
(
2
,
0
,
1
))
# [H, W, rgb] -> [rgb, H, W]
rgb_norm
=
rgb
/
255.0
rgb_norm
=
rgb
/
255.0
*
2.0
-
1.0
# [0, 255] -> [-1, 1]
rgb_norm
=
torch
.
from_numpy
(
rgb_norm
).
to
(
self
.
dtype
)
rgb_norm
=
rgb_norm
.
to
(
device
)
assert
rgb_norm
.
min
()
>=
0
.0
and
rgb_norm
.
max
()
<=
1.0
assert
rgb_norm
.
min
()
>=
-
1
.0
and
rgb_norm
.
max
()
<=
1.0
# ----------------- Predicting depth -----------------
# Batch repeated input image
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment