Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import io
|
2 |
import os
|
|
|
3 |
import numpy as np
|
4 |
import cv2
|
5 |
import torch
|
@@ -10,11 +11,14 @@ import uvicorn
|
|
10 |
|
11 |
app = FastAPI()
|
12 |
|
13 |
-
# 🟢 Clone FastDepth từ GitHub
|
14 |
if not os.path.exists("fastdepth"):
|
15 |
os.system("git clone https://github.com/dwofk/fast-depth.git fastdepth")
|
16 |
|
17 |
-
# 🟢
|
|
|
|
|
|
|
18 |
from fastdepth.models import MobileNetSkipAdd # Model chính của FastDepth
|
19 |
|
20 |
# 🟢 Load mô hình FastDepth
|
|
|
1 |
import io
|
2 |
import os
|
3 |
+
import sys
|
4 |
import numpy as np
|
5 |
import cv2
|
6 |
import torch
|
|
|
11 |
|
12 |
app = FastAPI()
|
13 |
|
14 |
+
# 🟢 Clone FastDepth từ GitHub nếu chưa có
|
15 |
if not os.path.exists("fastdepth"):
|
16 |
os.system("git clone https://github.com/dwofk/fast-depth.git fastdepth")
|
17 |
|
18 |
+
# 🟢 Thêm `fastdepth` vào `sys.path`
|
19 |
+
sys.path.append(os.path.abspath("fastdepth"))
|
20 |
+
|
21 |
+
# 🟢 Import FastDepth
|
22 |
from fastdepth.models import MobileNetSkipAdd # Model chính của FastDepth
|
23 |
|
24 |
# 🟢 Load mô hình FastDepth
|