将检测任务迁移python

This commit is contained in:
2025-09-30 17:34:54 +08:00
parent e82d919ebf
commit 197ff9b888
6 changed files with 28 additions and 18 deletions

View File

@@ -11,7 +11,8 @@ public final class ModelManager implements AutoCloseable {
private final Map<String, YoloDetector> map = new LinkedHashMap<>();
// Python服务的默认API URL
private static final String DEFAULT_PYTHON_API_URL = "http://localhost:8000/api/detect/file";
// 支持环境变量配置Docker环境使用容器名
private static final String DEFAULT_PYTHON_API_URL = System.getenv().getOrDefault("PYTHON_API_URL", "http://localhost:8000") + "/api/detect/file";
/**
* 从配置加载检测器