Spaces:
Runtime error
Runtime error
syurein
commited on
Commit
·
73a65ab
1
Parent(s):
ef356f3
エラーハンドリングの強化
Browse files
app.py
CHANGED
|
@@ -1204,12 +1204,11 @@ async def create_mask_sum2(image: UploadFile = File(...), risk_level: int = Form
|
|
| 1204 |
print('point1,point2',point1,point2)#消去したくない範囲のこと
|
| 1205 |
# OpenCVでインペイント
|
| 1206 |
inpaint_image_with_mask1(input_path, mask_path, output_path)
|
| 1207 |
-
|
| 1208 |
-
response = response['danger'] # レスポンスから必要な情報を抽出
|
| 1209 |
return FileResponse(
|
| 1210 |
output_path,
|
| 1211 |
media_type="image/jpeg",
|
| 1212 |
-
headers={"x-danger": str(
|
| 1213 |
)
|
| 1214 |
|
| 1215 |
|
|
|
|
| 1204 |
print('point1,point2',point1,point2)#消去したくない範囲のこと
|
| 1205 |
# OpenCVでインペイント
|
| 1206 |
inpaint_image_with_mask1(input_path, mask_path, output_path)
|
| 1207 |
+
|
|
|
|
| 1208 |
return FileResponse(
|
| 1209 |
output_path,
|
| 1210 |
media_type="image/jpeg",
|
| 1211 |
+
headers={"x-danger": str(random.random()*100)} # 実際の処理では危険度を適切に設定
|
| 1212 |
)
|
| 1213 |
|
| 1214 |
|