feat:
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix: 替换项目中所有mmcv的依赖
This commit is contained in:
@@ -11,7 +11,6 @@ import logging
|
||||
import uuid
|
||||
|
||||
import cv2
|
||||
import mmcv
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import torch
|
||||
@@ -21,6 +20,7 @@ from minio import Minio
|
||||
from tritonclient.utils import np_to_triton_dtype
|
||||
|
||||
from app.core.config import settings, FAST_GI_MODEL_URL, GI_MODEL_URL, DESIGN_MODEL_URL, FAST_GI_MODEL_NAME, GI_MODEL_NAME
|
||||
from app.service.utils.image_normalize import my_imnormalize
|
||||
from app.service.utils.new_oss_client import oss_upload_image
|
||||
|
||||
logger = logging.getLogger()
|
||||
@@ -86,10 +86,9 @@ class AgentToolGenerateImage:
|
||||
|
||||
@staticmethod
|
||||
def preprocess(img):
|
||||
img = mmcv.imread(img)
|
||||
img_scale = (224, 224)
|
||||
img = cv2.resize(img, img_scale)
|
||||
img = mmcv.imnormalize(
|
||||
img = my_imnormalize(
|
||||
img,
|
||||
mean=np.array([123.675, 116.28, 103.53]), std=np.array([58.395, 57.12, 57.375]),
|
||||
to_rgb=True)
|
||||
|
||||
@@ -189,10 +189,10 @@ if __name__ == '__main__':
|
||||
tasks_id="123-89",
|
||||
prompt="a single item of sketch of dress, 4k, white background",
|
||||
image_url="aida-collection-element/89/Sketchboard/95f20cdc-e059-435c-b8b1-d04cc9e80c3d.png",
|
||||
mode='img2img',
|
||||
mode='txt2img',
|
||||
category="sketch",
|
||||
gender="Female",
|
||||
version="fast"
|
||||
version="hight"
|
||||
)
|
||||
server = GenerateImage(rd)
|
||||
print(server.get_result())
|
||||
|
||||
@@ -2,23 +2,23 @@ import logging
|
||||
import time
|
||||
|
||||
import cv2
|
||||
import mmcv
|
||||
import numpy as np
|
||||
import torch
|
||||
import tritonclient.http as httpclient
|
||||
|
||||
from app.core.config import settings, DESIGN_MODEL_URL, DESIGN_MODEL_NAME
|
||||
from app.service.generate_image.utils.upload_sd_image import upload_stain_png_sd, upload_face_png_sd
|
||||
from app.service.utils.image_normalize import my_imnormalize
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
|
||||
def seg_preprocess(img_path):
|
||||
img = mmcv.imread(img_path)
|
||||
img = img_path
|
||||
ori_shape = img.shape[:2]
|
||||
img_scale = ori_shape
|
||||
img = cv2.resize(img, img_scale)
|
||||
img = mmcv.imnormalize(img, mean=np.array([123.675, 116.28, 103.53]), std=np.array([58.395, 57.12, 57.375]), to_rgb=True)
|
||||
img = my_imnormalize(img, mean=np.array([123.675, 116.28, 103.53]), std=np.array([58.395, 57.12, 57.375]), to_rgb=True)
|
||||
preprocessed_img = np.expand_dims(img.transpose(2, 0, 1), axis=0)
|
||||
return preprocessed_img, ori_shape
|
||||
|
||||
@@ -242,10 +242,9 @@ def stain_detection(image, user_id, category, tasks_id, spot_size=100):
|
||||
|
||||
def generate_category_recognition(image, gender):
|
||||
def preprocess(img):
|
||||
img = mmcv.imread(img)
|
||||
img_scale = (224, 224)
|
||||
img = cv2.resize(img, img_scale)
|
||||
img = mmcv.imnormalize(img, mean=np.array([123.675, 116.28, 103.53]), std=np.array([58.395, 57.12, 57.375]), to_rgb=True)
|
||||
img = my_imnormalize(img, mean=np.array([123.675, 116.28, 103.53]), std=np.array([58.395, 57.12, 57.375]), to_rgb=True)
|
||||
preprocessed_img = np.expand_dims(img.transpose(2, 0, 1), axis=0)
|
||||
return preprocessed_img
|
||||
|
||||
|
||||
Reference in New Issue
Block a user