基于 FastAPI 开发 Ultralytics Serving
Inference service based on Ultralytics
创建虚拟环境
python -m venv venv source venv/bin/activate
安装依赖包
创建 requirements.txt
fastapi
python-multipart
aiofiles
onnxruntime
ultralytics
uvicorn[standard]
gunicorn
pytest
httpx
安装
pip install -r requirements.txt
调试
创建 launch.json 文件,用于调试 FastAPI 应用。
.vscode/launch.json { "version": "0.2.0", "configurations": [ { "name": "Python: FastAPI", "type": "python", "request": "launch", "module": "uvicorn", "args": [ "app.













