Update app.py
Browse files
app.py
CHANGED
|
@@ -161,14 +161,14 @@ def input_to_glb(outdir,img,depth_dict,mask,rotated=False):
|
|
| 161 |
scene.export(outfile)
|
| 162 |
return outfile
|
| 163 |
|
| 164 |
-
@GPU(duration =
|
| 165 |
def depth_moge(input_img):
|
| 166 |
|
| 167 |
input_img_torch = torch.tensor(input_img / 255, dtype=torch.float32, device=device).permute(2, 0, 1)
|
| 168 |
output = moge_model.infer(input_img_torch)
|
| 169 |
return output
|
| 170 |
|
| 171 |
-
@GPU(duration =
|
| 172 |
def mask_rembg(input_img):
|
| 173 |
#masked_img = rembg.remove(input_img,)
|
| 174 |
output_img = rembg.remove(input_img, alpha_matting=False, post_process_mask=True)
|
|
@@ -187,7 +187,7 @@ def mask_rembg(input_img):
|
|
| 187 |
rgb = output_np[:,:,:3]
|
| 188 |
return mask, rgb
|
| 189 |
|
| 190 |
-
@GPU(duration =
|
| 191 |
def process_image(input_img):
|
| 192 |
|
| 193 |
rotated = False
|
|
|
|
| 161 |
scene.export(outfile)
|
| 162 |
return outfile
|
| 163 |
|
| 164 |
+
@GPU(duration = 10)
|
| 165 |
def depth_moge(input_img):
|
| 166 |
|
| 167 |
input_img_torch = torch.tensor(input_img / 255, dtype=torch.float32, device=device).permute(2, 0, 1)
|
| 168 |
output = moge_model.infer(input_img_torch)
|
| 169 |
return output
|
| 170 |
|
| 171 |
+
@GPU(duration = 10)
|
| 172 |
def mask_rembg(input_img):
|
| 173 |
#masked_img = rembg.remove(input_img,)
|
| 174 |
output_img = rembg.remove(input_img, alpha_matting=False, post_process_mask=True)
|
|
|
|
| 187 |
rgb = output_np[:,:,:3]
|
| 188 |
return mask, rgb
|
| 189 |
|
| 190 |
+
@GPU(duration = 10)
|
| 191 |
def process_image(input_img):
|
| 192 |
|
| 193 |
rotated = False
|