upgrade: infrared-data 0.1.0 -> 0.2.0

Breaking API changes in upstream:
- TempFeatureExtractor no longer accepts model_path
- Use FaultDiagnoser.diagnose() for detection + temp extraction
- Image should be grayscale (matching file-path behavior)
This commit is contained in:
SkyLi
2026-03-29 01:05:28 +08:00
parent 1e6a4fb6c5
commit 8c4ba20920
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -8,5 +8,5 @@ dependencies = [
"uvicorn[standard]>=0.30.0",
"python-multipart>=0.0.12",
"aiofiles>=24.0.0",
"infrared-data @ file://${PROJECT_ROOT}/lib/infrared_data-0.1.0-py3-none-any.whl",
"infrared-data @ file://${PROJECT_ROOT}/lib/infrared_data-0.2.0-py3-none-any.whl",
]
+2 -2
View File
@@ -47,9 +47,9 @@ async def infer(image: UploadFile = File(...)) -> dict:
}
}
"""
# 读取图片内容
# 读取图片内容(转灰度,与 diagnose.py 对文件路径的处理逻辑一致)
contents = await image.read()
img = Image.open(io.BytesIO(contents)).convert("RGB")
img = Image.open(io.BytesIO(contents)).convert("L")
img_array = np.array(img)
diagnoser = get_diagnoser()