feat 代码整理
fix
This commit is contained in:
@@ -4,7 +4,7 @@ import numpy as np
|
||||
from pymilvus import MilvusClient
|
||||
|
||||
from app.core.config import *
|
||||
from app.service.design.utils.design_ensemble import get_keypoint_result
|
||||
from app.service.design_batch.utils.design_ensemble import get_keypoint_result
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import io
|
||||
import logging
|
||||
|
||||
import cv2
|
||||
import numpy as np
|
||||
from PIL import Image
|
||||
|
||||
from app.service.utils.new_oss_client import oss_get_image
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class Scaling:
|
||||
-
|
||||
int(result['body_point_test'][result['keypoint'] + '_right'][0])) ** 2 + 1
|
||||
)
|
||||
|
||||
|
||||
if distance_clo == 0:
|
||||
result['scale'] = 1
|
||||
else:
|
||||
|
||||
@@ -5,7 +5,7 @@ import cv2
|
||||
import numpy as np
|
||||
|
||||
from app.core.config import SEG_CACHE_PATH
|
||||
from app.service.design.utils.design_ensemble import get_seg_result
|
||||
from app.service.design_batch.utils.design_ensemble import get_seg_result
|
||||
from app.service.utils.new_oss_client import oss_get_image
|
||||
|
||||
logger = logging.getLogger()
|
||||
@@ -48,7 +48,7 @@ class Segmentation:
|
||||
|
||||
@staticmethod
|
||||
def save_seg_result(seg_result, image_id):
|
||||
file_path = f"{SEG_CACHE_PATH}{image_id}.npy"
|
||||
file_path = f"seg_cache/{image_id}.npy"
|
||||
try:
|
||||
np.save(file_path, seg_result)
|
||||
logger.info(f"保存成功 :{os.path.abspath(file_path)}")
|
||||
@@ -57,7 +57,7 @@ class Segmentation:
|
||||
|
||||
@staticmethod
|
||||
def load_seg_result(image_id):
|
||||
file_path = f"{SEG_CACHE_PATH}{image_id}.npy"
|
||||
file_path = f"seg_cache/{image_id}.npy"
|
||||
logger.info(f"load seg file name is :{SEG_CACHE_PATH}{image_id}.npy")
|
||||
try:
|
||||
seg_result = np.load(file_path)
|
||||
|
||||
@@ -7,8 +7,8 @@ from PIL import Image
|
||||
from cv2 import cvtColor, COLOR_BGR2RGBA
|
||||
|
||||
from app.core.config import AIDA_CLOTHING
|
||||
from app.service.design.utils.conversion_image import rgb_to_rgba
|
||||
from app.service.design_fast.utils.upload_image import upload_png_mask
|
||||
from app.service.design_batch.utils.conversion_image import rgb_to_rgba
|
||||
from app.service.design_batch.utils.upload_image import upload_png_mask
|
||||
from app.service.utils.generate_uuid import generate_uuid
|
||||
from app.service.utils.new_oss_client import oss_upload_image
|
||||
|
||||
|
||||
Reference in New Issue
Block a user