整体项目重构

This commit is contained in:
sml2h3 2024-07-30 15:36:39 +08:00
parent abbd580b7a
commit 901103a7e3
2 changed files with 11 additions and 9 deletions

View File

@ -107,12 +107,14 @@
🔗 **端点**`POST /slide_match` 🔗 **端点**`POST /slide_match`
| 参数 | 类型 | 描述 | | 参数 | 类型 | 描述 |
|------|------|------| |-------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
| `target_file` | File | 目标图片文件(可选) | | `target_file` | File | 目标图片文件(可选)需要与target字段同时使用 |
| `background_file` | File | 背景图片文件(可选) | | `target` | String | Base64 编码的目标图片字符串(可选) 需要与target_file字段同时使用 |
| `target` | String | Base64 编码的目标图片字符串(可选) | | `background_file` | File | 背景图片文件(可选) 需要与background字段同时使用 |
| `background` | String | Base64 编码的背景图片字符串(可选) | | `background` | String | Base64 编码的背景图片字符串(可选) 需要与background_file字段同时使用 |
| `simple_target` | Boolean | 是否使用简单目标默认false | | `simple_target` | Boolean | 是否使用简单目标默认false |
|| | `target_file`和`target` 为一组字段,`background_file`和`background` 为一组字段, 两组字段不可同时使用,同时使用则仅一组会生效 |
### 3. 目标检测 ### 3. 目标检测

View File

@ -2,8 +2,8 @@ import uvicorn
from fastapi import FastAPI, File, UploadFile, HTTPException, Form from fastapi import FastAPI, File, UploadFile, HTTPException, Form
from typing import Optional, Union from typing import Optional, Union
import base64 import base64
from app.models import OCRRequest, SlideMatchRequest, DetectionRequest, APIResponse from models import OCRRequest, SlideMatchRequest, DetectionRequest, APIResponse
from app.services import ocr_service from services import ocr_service
app = FastAPI() app = FastAPI()