Spaces:
Running on Zero
Running on Zero
Lord-Raven commited on
Commit ·
4434efc
1
Parent(s): f3daba7
Trying to fix predict_depth.
Browse files
app.py
CHANGED
|
@@ -111,7 +111,7 @@ description = """This is an endpoint for some image operations for a Chub.ai sta
|
|
| 111 |
but now also includes [BRIA](https://huggingface.co/briaai/RMBG-1.4) for background removal."""
|
| 112 |
|
| 113 |
@spaces.GPU(duration=6)
|
| 114 |
-
def
|
| 115 |
return model.infer_image(image)
|
| 116 |
|
| 117 |
with gr.Blocks(css=css) as demo:
|
|
@@ -142,7 +142,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 142 |
|
| 143 |
h, w = image.shape[:2]
|
| 144 |
|
| 145 |
-
depth =
|
| 146 |
|
| 147 |
raw_depth = Image.fromarray(depth.astype('uint16'))
|
| 148 |
tmp_raw_depth = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
|
|
|
|
| 111 |
but now also includes [BRIA](https://huggingface.co/briaai/RMBG-1.4) for background removal."""
|
| 112 |
|
| 113 |
@spaces.GPU(duration=6)
|
| 114 |
+
def predict_depth_image(image):
|
| 115 |
return model.infer_image(image)
|
| 116 |
|
| 117 |
with gr.Blocks(css=css) as demo:
|
|
|
|
| 142 |
|
| 143 |
h, w = image.shape[:2]
|
| 144 |
|
| 145 |
+
depth = predict_depth_image(image[:, :, ::-1])
|
| 146 |
|
| 147 |
raw_depth = Image.fromarray(depth.astype('uint16'))
|
| 148 |
tmp_raw_depth = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
|