|
@@ -27,6 +27,7 @@ async def checkSelect(params: CheckSelectImages):
|
|
|
# print("need_cutout_images",need_cutout_images)
|
|
# print("need_cutout_images",need_cutout_images)
|
|
|
if len([x for x in need_cutout_images if x["need_cutout"]]) == 0:
|
|
if len([x for x in need_cutout_images if x["need_cutout"]]) == 0:
|
|
|
raise UnicornException("您所选文件夹下没有jpg/png图片,或对应图片已扣图")
|
|
raise UnicornException("您所选文件夹下没有jpg/png图片,或对应图片已扣图")
|
|
|
|
|
+ service.need_cutout_images = []
|
|
|
return success(need_cutout_images)
|
|
return success(need_cutout_images)
|
|
|
|
|
|
|
|
@app.post("/api/segment_images", description="执行抠图操作")
|
|
@app.post("/api/segment_images", description="执行抠图操作")
|
|
@@ -75,6 +76,11 @@ def model_form_segment(params:ModelFormModel):
|
|
|
raise UnicornException("您所选文件夹下没有jpg/png图片,或对应图片已扣图")
|
|
raise UnicornException("您所选文件夹下没有jpg/png图片,或对应图片已扣图")
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
|
raise UnicornException(repr(e))
|
|
raise UnicornException(repr(e))
|
|
|
|
|
+ try:
|
|
|
|
|
+ if len([x for x in need_cutout_images if x["need_cutout"]]) > 30:
|
|
|
|
|
+ raise UnicornException("最多允许上传30张图片")
|
|
|
|
|
+ except Exception as e:
|
|
|
|
|
+ raise UnicornException(repr(e))
|
|
|
modelFormClazz = DealModelForm(token=params.token,params=params)
|
|
modelFormClazz = DealModelForm(token=params.token,params=params)
|
|
|
modelFormClazz.need_cutout_images = need_cutout_images
|
|
modelFormClazz.need_cutout_images = need_cutout_images
|
|
|
result ,save_root_path,generate_ids=modelFormClazz.startDispose()
|
|
result ,save_root_path,generate_ids=modelFormClazz.startDispose()
|