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:
+1
-1
@@ -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
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user