chawin.chen commited on
Commit
0446d17
·
1 Parent(s): e06214d
Files changed (1) hide show
  1. api_routes.py +2 -3
api_routes.py CHANGED
@@ -1033,12 +1033,11 @@ async def upload_file(
1033
  try:
1034
  with open(saved_path, "wb") as f:
1035
  f.write(contents)
1036
- bos_uploaded = upload_file_to_bos(saved_path)
1037
  await _record_output_file(
1038
  file_path=saved_path,
1039
  nickname=nickname,
1040
  category="id_photo",
1041
- bos_uploaded=bos_uploaded,
1042
  extra={
1043
  **{k: v for k, v in extra_meta_base.items() if v},
1044
  "restored_with_model": False,
@@ -1096,7 +1095,7 @@ async def analyze_face(
1096
  original_md5_hash = str(uuid.uuid4()).replace('-', '')
1097
  original_image_filename = f"{original_md5_hash}_original.webp"
1098
  original_image_path = os.path.join(IMAGES_DIR, original_image_filename)
1099
- save_image_high_quality(image, original_image_path, quality=SAVE_QUALITY)
1100
  # 🔥 添加图片安全检测
1101
  t1 = time.perf_counter()
1102
  is_safe = await wx_access_token.check_image_security(contents)
 
1033
  try:
1034
  with open(saved_path, "wb") as f:
1035
  f.write(contents)
 
1036
  await _record_output_file(
1037
  file_path=saved_path,
1038
  nickname=nickname,
1039
  category="id_photo",
1040
+ bos_uploaded=True,
1041
  extra={
1042
  **{k: v for k, v in extra_meta_base.items() if v},
1043
  "restored_with_model": False,
 
1095
  original_md5_hash = str(uuid.uuid4()).replace('-', '')
1096
  original_image_filename = f"{original_md5_hash}_original.webp"
1097
  original_image_path = os.path.join(IMAGES_DIR, original_image_filename)
1098
+ save_image_high_quality(image, original_image_path, quality=SAVE_QUALITY, upload_to_bos=False)
1099
  # 🔥 添加图片安全检测
1100
  t1 = time.perf_counter()
1101
  is_safe = await wx_access_token.check_image_security(contents)