# image-annotation-fastapi-postgresql-admin **Repository Path**: fuwenwei501/image-annotation-fastapi-postgresql-admin ## Basic Information - **Project Name**: image-annotation-fastapi-postgresql-admin - **Description**: 图像标注软件的后端接口,数据库采用 postgresql - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 1 - **Created**: 2021-09-15 - **Last Updated**: 2024-07-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 图像标注软件系统 ## 安装和启动 ```sh # 安装依赖 pip install -r requirements.txt # 启动 可以使用下面的方法 uvicorn app.main:app --reload --host 0.0.0.0 --port 8001 ``` ## 配置 ### 数据库配置 修改 `.env` 中的数据库配置: ```sh SECRET_KEY=secret DEBUG=True DB_CONNECTION=postgres://postgres:123456@localhost/traffic HOST=localhost PORT=5432 USERNAME=postgres PASSWORD=123456 DATABASE=traffic ``` ### 数据库表设计 在 `app/db/schemas.py` 中编写数据库表 ### api 设计 具体的 `api` 文档在 `app/api/routes/` 这个路径下编写,编写完成后在 `app/api/routes/api.py` 中引入编写的文档即可。 ### 线上部署 线上部署时,要修改 数据库 的配置,host 和 port 修改为自己的配置。 修改 `.env` 中的 图片访问和保存地址: ```sh # 图片访问和保存地址 ImagesUrl=http://39.99.145.119:9002/api/draw ROOT_FILE_PATH=/home/fastapi/static/images ``` ```sh # 构建镜像 docker build -t draw-ailabel-fastapi-admin . # 运行镜像 docker run -d -p 9002:9002 -v /root/drawAILabel/image-annotation-fastapi-postgresql-admin/static/images:/home/fastapi/static/images --name draw-ailabel-fastapi-admin draw-ailabel-fastapi-admin ```