Update app.py
Browse files
app.py
CHANGED
|
@@ -53,13 +53,14 @@ def get_openpos_image(image):
|
|
| 53 |
|
| 54 |
|
| 55 |
def get_depth_image(image):
|
| 56 |
-
|
|
|
|
| 57 |
depth_estimator = pipeline('depth-estimation')
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
return PIL.Image.fromarray(
|
| 63 |
|
| 64 |
|
| 65 |
control_net_modes = {
|
|
|
|
| 53 |
|
| 54 |
|
| 55 |
def get_depth_image(image):
|
| 56 |
+
pil_image = PIL.Image.fromarray(image)
|
| 57 |
+
print("Image type", type(pil_image))
|
| 58 |
depth_estimator = pipeline('depth-estimation')
|
| 59 |
+
pil_image = depth_estimator(pil_image)['depth']
|
| 60 |
+
pil_image = np.array(pil_image)
|
| 61 |
+
pil_image = image[:, :, None]
|
| 62 |
+
pil_image = np.concatenate([pil_image, pil_image, pil_image], axis=2)
|
| 63 |
+
return PIL.Image.fromarray(pil_image)
|
| 64 |
|
| 65 |
|
| 66 |
control_net_modes = {
|