|
|
@@ -46,10 +46,13 @@ class OnePicTest():
|
|
|
check_path("temp")
|
|
|
check_path("temp\pic_test")
|
|
|
root = r"{}\temp\pic_test".format(os.getcwd())
|
|
|
- for file_name in os.listdir(root):
|
|
|
- path = "{}\{}".format(root, file_name)
|
|
|
- if os.path.isfile(path):
|
|
|
- os.remove(path)
|
|
|
+ try:
|
|
|
+ for file_name in os.listdir(root):
|
|
|
+ path = "{}\{}".format(root, file_name)
|
|
|
+ if os.path.isfile(path):
|
|
|
+ os.remove(path)
|
|
|
+ except Exception as e:
|
|
|
+ print("deal_image", e)
|
|
|
|
|
|
# ==============抠图处理=====================
|
|
|
remove_pic_ins = RemoveBgALi()
|
|
|
@@ -66,8 +69,8 @@ class OnePicTest():
|
|
|
print("image_path", image_path)
|
|
|
print("cut_image_path", cut_image_path)
|
|
|
print("main_out_path", main_out_path)
|
|
|
- try:
|
|
|
- GeneratePic().run(
|
|
|
+ # try:
|
|
|
+ GeneratePic().run(
|
|
|
image_path=image_path,
|
|
|
cut_image_path=cut_image_path,
|
|
|
out_path=main_out_path,
|
|
|
@@ -76,9 +79,9 @@ class OnePicTest():
|
|
|
out_pic_size=1024,
|
|
|
is_logo=False,
|
|
|
)
|
|
|
- except Exception as e:
|
|
|
- print(e)
|
|
|
- raise UnicornException("处理失败,请重试")
|
|
|
+ # except Exception as e:
|
|
|
+ # print(e)
|
|
|
+ # raise UnicornException("处理失败,请重试")
|
|
|
|
|
|
# return_data["code"] = 0
|
|
|
# return_data["data"]["image_path"] = image_path
|