fixed ai server binding
This commit is contained in:
parent
d02337fd49
commit
a59239bd36
@ -383,6 +383,13 @@ def predict_batch(req: PredictBatchRequest):
|
|||||||
"error": _MODEL_ERROR or f"YOLO model not found: {DEFAULT_MODEL_PATH}",
|
"error": _MODEL_ERROR or f"YOLO model not found: {DEFAULT_MODEL_PATH}",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if DETECTION_LABELS_PATH is None or _LABEL_ERROR:
|
||||||
|
return {
|
||||||
|
"ok": False,
|
||||||
|
"predictions": [],
|
||||||
|
"error": f"detection labels missing: {_LABEL_ERROR}",
|
||||||
|
}
|
||||||
|
|
||||||
imgsz = int(req.imageSize or _IMGSZ or 640)
|
imgsz = int(req.imageSize or _IMGSZ or 640)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -314,7 +314,7 @@ func startAIServer(ctx context.Context) (*aiServerProcess, error) {
|
|||||||
args = append(args,
|
args = append(args,
|
||||||
"-m", "uvicorn",
|
"-m", "uvicorn",
|
||||||
"ai_server:app",
|
"ai_server:app",
|
||||||
"--host", "127.0.0.1",
|
"--host", "0.0.0.0",
|
||||||
"--port", port,
|
"--port", port,
|
||||||
"--log-level", "error",
|
"--log-level", "error",
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user