소스 검색

Merge branch 'dev-python'

rambo 11 달 전
부모
커밋
7dafb26efe
2개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      python/services/SegmentService.py
  2. 4 0
      python/services/deal_cutout.py

+ 2 - 1
python/services/SegmentService.py

@@ -59,7 +59,8 @@ class SegmentService:
                     for x_file in os.listdir(file_path):
                         x_file_name, x_file_e = os.path.splitext(x_file)
                         if x_file_e == ".png":
-                            _is_cutout.append(x_file_name)
+                            continue
+                            # _is_cutout.append(x_file_name)
         # ===============================================================
         for file in os.listdir(root_path):
             file_path = "{}/{}".format(root_path, file)

+ 4 - 0
python/services/deal_cutout.py

@@ -279,8 +279,12 @@ class DealModelForm:
                     file_name = generate["file_name"]
                     file_e = generate["file_e"]
                     if result_image_pil.mode == "RGBA":
+                        if os.path.exists(f"{save_path}/{file_name}.png"):
+                            continue
                         result_image_pil.save(f"{save_path}/{file_name}.png")
                     else:
+                        if os.path.exists(f"{save_path}/{file_name}.jpg"):
+                            continue
                         result_image_pil.save(f"{save_path}/{file_name}.jpg")
                     break
         is_finished = (