rishik1111 commited on
Commit
fba59bc
·
1 Parent(s): 63c5f12

fix(pipeline): resolve self.face_encoder attribute error and increase uvicorn keep-alive for Render

Browse files
Files changed (3) hide show
  1. app.py +1 -1
  2. app/pipeline.py +1 -1
  3. chain/blockchain.json +75 -0
app.py CHANGED
@@ -5,7 +5,7 @@ from pathlib import Path
5
 
6
  def run_server(port: int = 8000, host: str = "127.0.0.1"):
7
  import uvicorn
8
- uvicorn.run("app.server:app", host=host, port=port, reload=False)
9
 
10
  def run_pipeline(image_path: Path, write_blockchain: bool = True, max_results: int = None, threshold: float = None):
11
  from app.pipeline import FaceIDPipeline
 
5
 
6
  def run_server(port: int = 8000, host: str = "127.0.0.1"):
7
  import uvicorn
8
+ uvicorn.run("app.server:app", host=host, port=port, reload=False, timeout_keep_alive=65)
9
 
10
  def run_pipeline(image_path: Path, write_blockchain: bool = True, max_results: int = None, threshold: float = None):
11
  from app.pipeline import FaceIDPipeline
app/pipeline.py CHANGED
@@ -202,7 +202,7 @@ class FaceIDPipeline:
202
  "biometrics": {
203
  "detected": face_info["detected"],
204
  "face_count": face_info["count"],
205
- "embedding_model": f"ArcFace 512-d ({getattr(self.encoder, 'model_name', 'buffalo_s')})",
206
  "embedding_persistent": False, # RAM only
207
  "det_score": face_info.get("det_score", 0.0),
208
  "face_boxes": face_info.get("face_boxes", []),
 
202
  "biometrics": {
203
  "detected": face_info["detected"],
204
  "face_count": face_info["count"],
205
+ "embedding_model": f"ArcFace 512-d ({getattr(self.face_encoder, 'model_name', 'buffalo_s')})",
206
  "embedding_persistent": False, # RAM only
207
  "det_score": face_info.get("det_score", 0.0),
208
  "face_boxes": face_info.get("face_boxes", []),
chain/blockchain.json CHANGED
@@ -1156,5 +1156,80 @@
1156
  },
1157
  "previous_hash": "3d93a113d4c6fe0da53d39e3f5fefad08e879ea9e8a5c019dbd737d24a03e9fd",
1158
  "hash": "f0b09b09a2d9c870c18c19f4150c556b69837f1ab2355d125250e7eeb4811a11"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1159
  }
1160
  ]
 
1156
  },
1157
  "previous_hash": "3d93a113d4c6fe0da53d39e3f5fefad08e879ea9e8a5c019dbd737d24a03e9fd",
1158
  "hash": "f0b09b09a2d9c870c18c19f4150c556b69837f1ab2355d125250e7eeb4811a11"
1159
+ },
1160
+ {
1161
+ "index": 10,
1162
+ "timestamp": 1788773057.0646725,
1163
+ "evidence_record": {
1164
+ "schema_version": "2.0",
1165
+ "protocol": "FaceID forensic evidence",
1166
+ "created_at": "2026-09-07T09:24:17.063930+00:00",
1167
+ "source_image": {
1168
+ "filename": "sample.jpg",
1169
+ "sha256": "954419c50ed11c9db3bd5453548eb1a2c39a967bfdc78dfc9e4f45a034d0ea3d",
1170
+ "phash": "e959968619697996"
1171
+ },
1172
+ "image": {
1173
+ "filename": "sample.jpg",
1174
+ "sha256": "954419c50ed11c9db3bd5453548eb1a2c39a967bfdc78dfc9e4f45a034d0ea3d",
1175
+ "phash": "e959968619697996"
1176
+ },
1177
+ "biometrics": {
1178
+ "detected": false,
1179
+ "face_count": 0,
1180
+ "embedding_model": "ArcFace 512-d (buffalo_s)",
1181
+ "embedding_persistent": false,
1182
+ "det_score": 0.0,
1183
+ "face_boxes": [],
1184
+ "landmarks": []
1185
+ },
1186
+ "face": {
1187
+ "detected": false,
1188
+ "count": 0,
1189
+ "embedding_generated": false,
1190
+ "det_score": 0.0,
1191
+ "face_boxes": [],
1192
+ "landmarks": []
1193
+ },
1194
+ "osint_search": {
1195
+ "provider": "SerpApi Google Lens",
1196
+ "total_candidates": 2,
1197
+ "error": null
1198
+ },
1199
+ "reverse_search": {
1200
+ "provider": "SerpApi Google Lens",
1201
+ "count": 2,
1202
+ "error": null
1203
+ },
1204
+ "best_match": {
1205
+ "title": "Rolling into a new era! Once Upon A KATAMARI out NOW on ...",
1206
+ "source": "Instagram",
1207
+ "link": "https://www.instagram.com/p/DQK_wc9iaHM/",
1208
+ "platform": "Instagram",
1209
+ "is_specific_post": true,
1210
+ "post_type": "Post",
1211
+ "cosine_similarity": null,
1212
+ "visual_similarity": 0.3658,
1213
+ "phash_distance": 28,
1214
+ "verified": false
1215
+ },
1216
+ "deepfake_analysis": {
1217
+ "label": "Deepfake",
1218
+ "risk_score": 0.6974,
1219
+ "confidence": 0.6974,
1220
+ "is_synthetic": true,
1221
+ "model": "prithivMLmods/Deep-Fake-Detector-v2-Model",
1222
+ "status": "ANALYZED"
1223
+ },
1224
+ "verification": {
1225
+ "status": "NO_CONFIRMED_MATCH",
1226
+ "best_similarity": 0.3658,
1227
+ "threshold": 0.9,
1228
+ "phash_max_distance": 12
1229
+ },
1230
+ "evidence_hash": "a2d488fbe5121f34c9efce756544e4a5b261fd3ef82e508e746441408f9cd333"
1231
+ },
1232
+ "previous_hash": "f0b09b09a2d9c870c18c19f4150c556b69837f1ab2355d125250e7eeb4811a11",
1233
+ "hash": "79b0ecb7accd2580888ccb491311fae5d2df03d226addcacf1b3b6833179319d"
1234
  }
1235
  ]