fix     seg cache debug
This commit is contained in:
zhouchengrong
2024-08-20 10:42:47 +08:00
parent 34fdc77cb3
commit aeaf7fbd9d

View File

@@ -1,13 +1,15 @@
import logging
import random
import cv2
import numpy as np
from PIL import Image
from app.service.utils.decorator import RunTime, ClassCallRunTime
from app.service.utils.oss_client import oss_get_image
from ..builder import PIPELINES
logger = logging.getLogger()
@PIPELINES.register_module()
class Painting(object):
@@ -28,6 +30,7 @@ class Painting(object):
resize_pattern = cv2.resize(pattern, (dim_image_w, dim_image_h), interpolation=cv2.INTER_AREA)
closed_mo = np.expand_dims(result['mask'], axis=2).repeat(3, axis=2)
gray_mo = np.expand_dims(result['gray'], axis=2).repeat(3, axis=2)
logger.info(f"image id is :{result['image_id']}")
get_image_fir = resize_pattern * (closed_mo / 255) * (gray_mo / 255)
result['pattern_image'] = get_image_fir.astype(np.uint8)
result['final_image'] = result['pattern_image']