Spaces:
Runtime error
Runtime error
pablo
commited on
Commit
·
efcd5c0
1
Parent(s):
670957e
lmao numpy array
Browse files
app.py
CHANGED
@@ -93,10 +93,12 @@ def predict(dict, depth, prompt="", negative_prompt="", guidance_scale=7.5, step
|
|
93 |
|
94 |
output = pipe(prompt = prompt, negative_prompt=negative_prompt, image=init_image, mask_image=mask, depth_image=depth_image, guidance_scale=guidance_scale, num_inference_steps=int(steps), strength=strength)
|
95 |
|
96 |
-
|
|
|
|
|
97 |
output_depth_vis = output_depth_vis.astype("uint8")
|
98 |
output_depth = Image.fromarray(output_depth_vis)
|
99 |
-
|
100 |
return output.rgb[0], output_depth, gr.update(visible=True)
|
101 |
|
102 |
|
|
|
93 |
|
94 |
output = pipe(prompt = prompt, negative_prompt=negative_prompt, image=init_image, mask_image=mask, depth_image=depth_image, guidance_scale=guidance_scale, num_inference_steps=int(steps), strength=strength)
|
95 |
|
96 |
+
depth_out = np.array(output.depth[0])
|
97 |
+
|
98 |
+
output_depth_vis = (depth_out - np.min(output.depth[0])) / (np.max(depth_out) - np.min(depth_out)) * 255
|
99 |
output_depth_vis = output_depth_vis.astype("uint8")
|
100 |
output_depth = Image.fromarray(output_depth_vis)
|
101 |
+
|
102 |
return output.rgb[0], output_depth, gr.update(visible=True)
|
103 |
|
104 |
|