|
@@ -2,7 +2,7 @@ from fastapi import FastAPI, Request, Form, File, UploadFile
|
|
|
from fastapi.templating import Jinja2Templates
|
|
|
from pydantic import BaseModel
|
|
|
from typing import List, Optional
|
|
|
-from utils.webutil import web_try
|
|
|
+from sx_utils import web_try
|
|
|
import cv2
|
|
|
import numpy as np
|
|
|
|
|
@@ -10,9 +10,12 @@ import torch
|
|
|
import base64
|
|
|
import random
|
|
|
|
|
|
-YOLO_DIR = '/workspace/yolov5'
|
|
|
+# YOLO_DIR = '/workspace/yolov5'
|
|
|
+YOLO_DIR = '/Users/sxkj/opt/python-workspace/yili-ocr/yl-ocr-layout/yolov5'
|
|
|
# WEIGHTS = '/data/yolov5/runs/train/yolov5x_layout_reuslt37/weights/best.pt'
|
|
|
-WEIGHTS = '/workspace/best.pt'
|
|
|
+# WEIGHTS = '/workspace/best.pt'
|
|
|
+WEIGHTS = '/Users/sxkj/opt/python-workspace/yili-ocr/yl-ocr-layout/best.pt'
|
|
|
+
|
|
|
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
|
|
|
|
|