chmawia commited on
Commit
829717a
Β·
verified Β·
1 Parent(s): 0d9eb24

Delete detect()

Browse files
Files changed (1) hide show
  1. detect() +0 -23
detect() DELETED
@@ -1,23 +0,0 @@
1
- import json
2
-
3
- def detect(image):
4
- try:
5
- file_1 = handle_file(image)
6
- except Exception as e:
7
- print("❌ File handling error:", e)
8
- return "❌ File Error", "❌ File Error", "❌ File Error"
9
-
10
- try:
11
- print("βœ… Sending request to backend...")
12
- result_text = backend.predict(image=file_1, api_name="/detect")
13
- print("βœ… API Response:", result_text)
14
-
15
- result = json.loads(result_text)
16
- if result.get("status") == "ok":
17
- return result["overall"], result["aigen"], result["deepfake"]
18
- else:
19
- print("❌ Unexpected API response:", result)
20
- return "❌ Unexpected Error", "❌ Unexpected Error", "❌ Unexpected Error"
21
- except Exception as e:
22
- print("❌ API call failed:", e)
23
- return "❌ API Error", "❌ API Error", "❌ API Error"