I just use the follwing code to provide a http server for testing:
`import yaml
import uvicorn
from fastapi import FastAPI, UploadFile, File
from model_task.models.layout_detection.yolo import LayoutDetectionYOLO
app = FastAPI()
with open('config.yaml', 'r', encoding= 'utf8') as file:
config = yaml.safe_load(file)
layout_config = config['tasks']['layout_detection']['model_config']
layout_model = LayoutDetectionYOLO(layout_config)
@app.post("/test")
async def test_inference(file: UploadFile = File()):
image = await file.read()
ori_layout_res = layout_model.predict([image])[0]
return {"result": ori_layout_res}
if name == 'main':
uvicorn.run(app='main:app', host='0.0.0.0', port=15000)
`
but got the error as below:

I don't know why ...Hope someone can help, thanks in advance!