raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /detect/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001E048A030D0>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。'))
因为没有启动
启动服务
uvicorn main:app --reload --host 0.0.0.0
访问地址http://127.0.0.1:8000/docs
成功返回