feat 处理多层sketch design出现的内搭越界问题
fix
This commit is contained in:
@@ -3,7 +3,6 @@ import os
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from app.core.config import SEG_CACHE_PATH
|
from app.core.config import SEG_CACHE_PATH
|
||||||
from app.service.utils.decorator import ClassCallRunTime
|
|
||||||
from ..builder import PIPELINES
|
from ..builder import PIPELINES
|
||||||
from ...utils.design_ensemble import get_seg_result
|
from ...utils.design_ensemble import get_seg_result
|
||||||
|
|
||||||
@@ -18,6 +17,7 @@ class Segmentation(object):
|
|||||||
# @ClassCallRunTime
|
# @ClassCallRunTime
|
||||||
def __call__(self, result):
|
def __call__(self, result):
|
||||||
_, seg_result = self.load_seg_result(result["image_id"])
|
_, seg_result = self.load_seg_result(result["image_id"])
|
||||||
|
result['seg_result'] = seg_result
|
||||||
if not _:
|
if not _:
|
||||||
result['seg_result'] = get_seg_result(result["image_id"], result['image'])
|
result['seg_result'] = get_seg_result(result["image_id"], result['image'])
|
||||||
self.save_seg_result(result['seg_result'][0], result['image_id'])
|
self.save_seg_result(result['seg_result'][0], result['image_id'])
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ class Split(object):
|
|||||||
result['front_mask'] = result['mask'].copy()
|
result['front_mask'] = result['mask'].copy()
|
||||||
result['back_mask'] = np.zeros_like(result['mask'])
|
result['back_mask'] = np.zeros_like(result['mask'])
|
||||||
else:
|
else:
|
||||||
temp_front = result['seg_result'] == 1
|
temp_front = result['seg_result'] == 1.0
|
||||||
result['front_mask'] = (result['mask'] * (temp_front + 0).astype(np.uint8))
|
result['front_mask'] = (result['mask'] * (temp_front + 0).astype(np.uint8))
|
||||||
temp_back = result['seg_result'] == 2
|
temp_back = result['seg_result'] == 2.0
|
||||||
result['back_mask'] = (result['mask'] * (temp_back + 0).astype(np.uint8))
|
result['back_mask'] = (result['mask'] * (temp_back + 0).astype(np.uint8))
|
||||||
|
|
||||||
if result['name'] in ('outwear', 'dress', 'blouse', 'skirt', 'trousers', 'tops', 'bottoms'):
|
if result['name'] in ('outwear', 'dress', 'blouse', 'skirt', 'trousers', 'tops', 'bottoms'):
|
||||||
|
|||||||
Reference in New Issue
Block a user