Update app.py
Browse files
app.py
CHANGED
|
@@ -4,8 +4,6 @@ from utils import colorize
|
|
| 4 |
from PIL import Image
|
| 5 |
import tempfile
|
| 6 |
|
| 7 |
-
#import json
|
| 8 |
-
|
| 9 |
|
| 10 |
DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 11 |
model = torch.hub.load('isl-org/ZoeDepth', "ZoeD_N", pretrained=True).to(DEVICE).eval()
|
|
@@ -13,8 +11,6 @@ model = torch.hub.load('isl-org/ZoeDepth', "ZoeD_N", pretrained=True).to(DEVICE)
|
|
| 13 |
def predict(image):
|
| 14 |
depth = model.infer_pil(image)
|
| 15 |
colored_depth = colorize(depth, cmap='gray_r')
|
| 16 |
-
|
| 17 |
-
#depth_json = "Hey" #json.dumps(depth.numpy())
|
| 18 |
|
| 19 |
return colored_depth
|
| 20 |
|
|
|
|
| 4 |
from PIL import Image
|
| 5 |
import tempfile
|
| 6 |
|
|
|
|
|
|
|
| 7 |
|
| 8 |
DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 9 |
model = torch.hub.load('isl-org/ZoeDepth', "ZoeD_N", pretrained=True).to(DEVICE).eval()
|
|
|
|
| 11 |
def predict(image):
|
| 12 |
depth = model.infer_pil(image)
|
| 13 |
colored_depth = colorize(depth, cmap='gray_r')
|
|
|
|
|
|
|
| 14 |
|
| 15 |
return colored_depth
|
| 16 |
|