Update app.py
Browse files
app.py
CHANGED
|
@@ -14,8 +14,8 @@ app = FastAPI()
|
|
| 14 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 15 |
|
| 16 |
# 🟢 Tải model DPT-Hybrid thay cho ZoeDepth để tăng tốc
|
| 17 |
-
feature_extractor = DPTFeatureExtractor.from_pretrained("Intel/dpt-
|
| 18 |
-
model = DPTForDepthEstimation.from_pretrained("Intel/dpt-
|
| 19 |
model.eval()
|
| 20 |
|
| 21 |
@app.post("/analyze_path/")
|
|
|
|
| 14 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 15 |
|
| 16 |
# 🟢 Tải model DPT-Hybrid thay cho ZoeDepth để tăng tốc
|
| 17 |
+
feature_extractor = DPTFeatureExtractor.from_pretrained("Intel/dpt-swinv2-tiny-256")
|
| 18 |
+
model = DPTForDepthEstimation.from_pretrained("Intel/dpt-swinv2-tiny-256").to(device)
|
| 19 |
model.eval()
|
| 20 |
|
| 21 |
@app.post("/analyze_path/")
|