Unverified Commit 98b6bee1 authored by Bingxin Ke's avatar Bingxin Ke Committed by GitHub
Browse files

[Community Pipeline][Bug Fix] marigold_depth_estimation: input image value range (#6787)

[FIX] IMPORTANT: rgb normalization
parent ab711348
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment