Rodrigo_Cobo
commited on
Commit
·
2c0045e
1
Parent(s):
fc21e39
fix depth issue
Browse files
app.py
CHANGED
|
@@ -46,16 +46,15 @@ def calculate_depth(model_type, img):
|
|
| 46 |
|
| 47 |
output = prediction.cpu().numpy()
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
#out_im = Image.fromarray(formatted)
|
| 52 |
out_im.save("Images/Input-Test/0_d.jpg", "JPEG")
|
| 53 |
|
| 54 |
return f'Images/Input-Test/0_d.jpg'
|
| 55 |
|
| 56 |
def wiggle_effect(slider):
|
| 57 |
|
| 58 |
-
return [f'
|
| 59 |
|
| 60 |
|
| 61 |
#pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
|
|
|
|
| 46 |
|
| 47 |
output = prediction.cpu().numpy()
|
| 48 |
|
| 49 |
+
formatted = (output * 255.0 / np.max(output)).astype('uint8')
|
| 50 |
+
out_im = Image.fromarray(formatted)
|
|
|
|
| 51 |
out_im.save("Images/Input-Test/0_d.jpg", "JPEG")
|
| 52 |
|
| 53 |
return f'Images/Input-Test/0_d.jpg'
|
| 54 |
|
| 55 |
def wiggle_effect(slider):
|
| 56 |
|
| 57 |
+
return [f'Images/Input-Test/0_d.jpg',f'Images/Input-Test/0_d.jpg']
|
| 58 |
|
| 59 |
|
| 60 |
#pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
|