|
@@ -47,25 +47,21 @@ async def segmentImages(params: SegmentImages):
|
|
|
if image_type == 1 and segment_type == 1:
|
|
if image_type == 1 and segment_type == 1:
|
|
|
raise UnicornException("服装暂不支持精细化抠图")
|
|
raise UnicornException("服装暂不支持精细化抠图")
|
|
|
elif image_type == 1 and segment_type == 0:
|
|
elif image_type == 1 and segment_type == 0:
|
|
|
- deal_cutout_cloth = DealCloths()
|
|
|
|
|
- deal_cutout_cloth.token = token
|
|
|
|
|
|
|
+ deal_cutout_cloth = DealCloths(token)
|
|
|
# 服装抠图
|
|
# 服装抠图
|
|
|
# need_cutout_images = service.check_need_cutout_images(file_path)
|
|
# need_cutout_images = service.check_need_cutout_images(file_path)
|
|
|
deal_cutout_cloth.need_cutout_images = need_cutout_images
|
|
deal_cutout_cloth.need_cutout_images = need_cutout_images
|
|
|
deal_cutout_cloth.output_type = output_type
|
|
deal_cutout_cloth.output_type = output_type
|
|
|
result = deal_cutout_cloth.startDispose()
|
|
result = deal_cutout_cloth.startDispose()
|
|
|
elif image_type == 0 and segment_type == 1:
|
|
elif image_type == 0 and segment_type == 1:
|
|
|
- deal_cutout_mode = DealCutout()
|
|
|
|
|
- deal_cutout_mode.token = token
|
|
|
|
|
|
|
+ deal_cutout_mode = DealCutout(token)
|
|
|
# 通用-精细化抠图
|
|
# 通用-精细化抠图
|
|
|
deal_cutout_mode.need_cutout_images = need_cutout_images
|
|
deal_cutout_mode.need_cutout_images = need_cutout_images
|
|
|
deal_cutout_mode.output_type = output_type
|
|
deal_cutout_mode.output_type = output_type
|
|
|
result = deal_cutout_mode.startDispose()
|
|
result = deal_cutout_mode.startDispose()
|
|
|
elif image_type == 0 and segment_type == 0:
|
|
elif image_type == 0 and segment_type == 0:
|
|
|
# 通用-普通抠图
|
|
# 通用-普通抠图
|
|
|
- deal_cutout_mode = DealCutout()
|
|
|
|
|
- deal_cutout_mode.token = token
|
|
|
|
|
- deal_cutout_mode.need_cutout_images = need_cutout_images
|
|
|
|
|
|
|
+ deal_cutout_mode = DealCutout(token)
|
|
|
deal_cutout_mode.output_type = output_type
|
|
deal_cutout_mode.output_type = output_type
|
|
|
result = deal_cutout_mode.normalMode()
|
|
result = deal_cutout_mode.normalMode()
|
|
|
return success({"result": result})
|
|
return success({"result": result})
|