verisight 2.2.3__tar.gz → 2.2.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {verisight-2.2.3/verisight.egg-info → verisight-2.2.5}/PKG-INFO +18 -1
  2. {verisight-2.2.3 → verisight-2.2.5}/README.md +17 -0
  3. {verisight-2.2.3 → verisight-2.2.5}/backend/__init__.py +1 -1
  4. {verisight-2.2.3 → verisight-2.2.5}/backend/agent.py +63 -18
  5. {verisight-2.2.3 → verisight-2.2.5}/backend/forensics.py +31 -2
  6. verisight-2.2.5/backend/generate_real_life_samples.py +292 -0
  7. {verisight-2.2.3 → verisight-2.2.5}/backend/main.py +4 -4
  8. {verisight-2.2.3 → verisight-2.2.5}/backend/mcp_server.py +2 -2
  9. {verisight-2.2.3 → verisight-2.2.5}/pyproject.toml +1 -1
  10. {verisight-2.2.3 → verisight-2.2.5/verisight.egg-info}/PKG-INFO +18 -1
  11. verisight-2.2.3/backend/generate_real_life_samples.py +0 -175
  12. {verisight-2.2.3 → verisight-2.2.5}/LICENSE +0 -0
  13. {verisight-2.2.3 → verisight-2.2.5}/backend/aws_adapter.py +0 -0
  14. {verisight-2.2.3 → verisight-2.2.5}/backend/benchmark_runner.py +0 -0
  15. {verisight-2.2.3 → verisight-2.2.5}/backend/cli.py +0 -0
  16. {verisight-2.2.3 → verisight-2.2.5}/backend/generate_demo_samples.py +0 -0
  17. {verisight-2.2.3 → verisight-2.2.5}/backend/test_mcp_tools.py +0 -0
  18. {verisight-2.2.3 → verisight-2.2.5}/backend/test_sanity.py +0 -0
  19. {verisight-2.2.3 → verisight-2.2.5}/setup.cfg +0 -0
  20. {verisight-2.2.3 → verisight-2.2.5}/verisight.egg-info/SOURCES.txt +0 -0
  21. {verisight-2.2.3 → verisight-2.2.5}/verisight.egg-info/dependency_links.txt +0 -0
  22. {verisight-2.2.3 → verisight-2.2.5}/verisight.egg-info/entry_points.txt +0 -0
  23. {verisight-2.2.3 → verisight-2.2.5}/verisight.egg-info/requires.txt +0 -0
  24. {verisight-2.2.3 → verisight-2.2.5}/verisight.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: verisight
3
- Version: 2.2.3
3
+ Version: 2.2.5
4
4
  Summary: Sub-3ms Physical Multi-Spectral Image Forensics & Presentation Attack Detection engine powered by OpenCV 5 and Model Context Protocol (MCP).
5
5
  Author-email: Aditya Raj Tiwari <adityasantosh2026@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -35,6 +35,7 @@ Dynamic: license-file
35
35
 
36
36
  [![VeriSight CI](https://github.com/Adityarajtiwari880/verisight/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Adityarajtiwari880/verisight/actions/workflows/ci.yml)
37
37
  [![PyPI version](https://img.shields.io/pypi/v/verisight.svg?color=blue)](https://pypi.org/project/verisight/)
38
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Adityarajtiwari880/verisight/blob/main/benchmarks/verisight_forensic_benchmark.ipynb)
38
39
  [![mcprush score](https://mcprush.com/badge/verisight-mcp/score.svg)](https://mcprush.com/to/verisight-mcp?ref=badge)
39
40
  [![M8ven Score](https://m8ven.ai/badge/mcp/adityarajtiwari880-verisight-11ohzr?v=5ddb567da1a0cb2e2f12567300d7ff24)](https://m8ven.ai/mcp/adityarajtiwari880-verisight-11ohzr?s=readme)
40
41
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
@@ -289,6 +290,19 @@ Executing 100 continuous perception-decision pipeline frames...
289
290
 
290
291
  ---
291
292
 
293
+ ### 🧪 1-Click Cloud Benchmark Suite (Zero Local Disk Space)
294
+
295
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Adityarajtiwari880/verisight/blob/main/benchmarks/verisight_forensic_benchmark.ipynb)
296
+
297
+ Evaluate VeriSight against real-world camera photographs, spliced manipulations, and generative AI inpaintings directly in the cloud with **0 KB local disk usage**:
298
+
299
+ * **Interactive Notebook:** [`benchmarks/verisight_forensic_benchmark.ipynb`](benchmarks/verisight_forensic_benchmark.ipynb)
300
+ * **Headless Evaluation Script:** [`benchmarks/run_colab_benchmark.py`](benchmarks/run_colab_benchmark.py)
301
+ * **Streaming Architecture:** Images are fetched in-memory (`RAM-only`) from standard vision corpuses (COCO, Open Images, OpenCV test suites) and evaluated on-the-fly without saving any image files to disk.
302
+ * **Metrics Generated:** Confusion Matrix, Precision, Recall, Specificity, F1-Score, Processing Latency, and ROC Curve.
303
+
304
+ ---
305
+
292
306
  ## 📁 Repository Structure
293
307
 
294
308
  ```
@@ -297,6 +311,9 @@ verisight/
297
311
  │ ├── workflows/ci.yml # Automated Python 3.11 & Next.js CI
298
312
  │ ├── ISSUE_TEMPLATE/ # Bug reports & feature requests
299
313
  │ └── PULL_REQUEST_TEMPLATE.md # Contributor review standards
314
+ ├── benchmarks/ # 1-Click cloud benchmark suite (Colab / RAM streaming)
315
+ │ ├── run_colab_benchmark.py # Headless streaming evaluator
316
+ │ └── verisight_forensic_benchmark.ipynb # Interactive notebook with confusion heatmaps
300
317
  ├── backend/
301
318
  │ ├── __init__.py # Python SDK exports (scan_image, verify_claim)
302
319
  │ ├── cli.py # Terminal CLI entry point (verisight command)
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![VeriSight CI](https://github.com/Adityarajtiwari880/verisight/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Adityarajtiwari880/verisight/actions/workflows/ci.yml)
4
4
  [![PyPI version](https://img.shields.io/pypi/v/verisight.svg?color=blue)](https://pypi.org/project/verisight/)
5
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Adityarajtiwari880/verisight/blob/main/benchmarks/verisight_forensic_benchmark.ipynb)
5
6
  [![mcprush score](https://mcprush.com/badge/verisight-mcp/score.svg)](https://mcprush.com/to/verisight-mcp?ref=badge)
6
7
  [![M8ven Score](https://m8ven.ai/badge/mcp/adityarajtiwari880-verisight-11ohzr?v=5ddb567da1a0cb2e2f12567300d7ff24)](https://m8ven.ai/mcp/adityarajtiwari880-verisight-11ohzr?s=readme)
7
8
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
@@ -256,6 +257,19 @@ Executing 100 continuous perception-decision pipeline frames...
256
257
 
257
258
  ---
258
259
 
260
+ ### 🧪 1-Click Cloud Benchmark Suite (Zero Local Disk Space)
261
+
262
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Adityarajtiwari880/verisight/blob/main/benchmarks/verisight_forensic_benchmark.ipynb)
263
+
264
+ Evaluate VeriSight against real-world camera photographs, spliced manipulations, and generative AI inpaintings directly in the cloud with **0 KB local disk usage**:
265
+
266
+ * **Interactive Notebook:** [`benchmarks/verisight_forensic_benchmark.ipynb`](benchmarks/verisight_forensic_benchmark.ipynb)
267
+ * **Headless Evaluation Script:** [`benchmarks/run_colab_benchmark.py`](benchmarks/run_colab_benchmark.py)
268
+ * **Streaming Architecture:** Images are fetched in-memory (`RAM-only`) from standard vision corpuses (COCO, Open Images, OpenCV test suites) and evaluated on-the-fly without saving any image files to disk.
269
+ * **Metrics Generated:** Confusion Matrix, Precision, Recall, Specificity, F1-Score, Processing Latency, and ROC Curve.
270
+
271
+ ---
272
+
259
273
  ## 📁 Repository Structure
260
274
 
261
275
  ```
@@ -264,6 +278,9 @@ verisight/
264
278
  │ ├── workflows/ci.yml # Automated Python 3.11 & Next.js CI
265
279
  │ ├── ISSUE_TEMPLATE/ # Bug reports & feature requests
266
280
  │ └── PULL_REQUEST_TEMPLATE.md # Contributor review standards
281
+ ├── benchmarks/ # 1-Click cloud benchmark suite (Colab / RAM streaming)
282
+ │ ├── run_colab_benchmark.py # Headless streaming evaluator
283
+ │ └── verisight_forensic_benchmark.ipynb # Interactive notebook with confusion heatmaps
267
284
  ├── backend/
268
285
  │ ├── __init__.py # Python SDK exports (scan_image, verify_claim)
269
286
  │ ├── cli.py # Terminal CLI entry point (verisight command)
@@ -30,7 +30,7 @@ from forensics import (
30
30
  tool_perceptual_hash
31
31
  )
32
32
 
33
- __version__ = "2.2.3"
33
+ __version__ = "2.2.5"
34
34
  __author__ = "Aditya Raj Tiwari"
35
35
  __license__ = "Apache-2.0"
36
36
 
@@ -38,7 +38,7 @@ class ForensicAgent:
38
38
  JPEG Ghost Sweeper, and PRNU Sensor Noise.
39
39
  """
40
40
  def __init__(self):
41
- self.version = "2.2.3"
41
+ self.version = "2.2.5"
42
42
 
43
43
  def run_investigation(
44
44
  self,
@@ -440,16 +440,18 @@ class ForensicAgent:
440
440
  # -------------------------------------------------------------
441
441
  clusters_detected = ela_meta.get("clusters_detected", 0)
442
442
  rx, ry, rw, rh = roi
443
- is_full_frame = (rw > 0.65 * working_dim[0] and rh > 0.65 * working_dim[1])
444
- has_isolated_cluster = not is_full_frame and (clusters_detected > 0) and (ela_score > 25.0)
443
+ roi_area = rw * rh
444
+ frame_area = working_dim[0] * working_dim[1]
445
+ is_full_frame = (rw > 0.70 * working_dim[0] and rh > 0.70 * working_dim[1]) or (roi_area > 0.55 * frame_area)
446
+ has_isolated_cluster = not is_full_frame and (clusters_detected > 0) and (ela_score > 25.0) and ela_meta.get("has_isolated_cluster", True)
445
447
 
446
448
  # Natural Camera vs Document / Synthetic Domain Differentiation:
447
449
  # In natural camera photos (damaged items, vehicles, nature, people), natural optical color transitions
448
450
  # produce high whole-frame chrominance variance that must not be confused with generative AI fringing.
449
451
  # In documents/vouchers, paper is predominantly monochrome/duotone so character editing creates high chrominance spikes.
450
- is_doc_or_voucher = scene_triage.get("has_document_structure", False) or any(
451
- k in claim_type.lower() for k in ["voucher", "coupon", "bill", "invoice", "receipt", "document", "text"]
452
- )
452
+ is_doc_or_voucher = any(
453
+ k in claim_type.lower() for k in ["voucher", "coupon", "bill", "invoice", "receipt", "document", "tax"]
454
+ ) or (scene_triage.get("has_document_structure", False) and scene_triage.get("text_lines_count", 0) >= 15 and not scene_triage.get("face_detected", False))
453
455
 
454
456
  # Generative AI detection & Corroboration:
455
457
  if is_doc_or_voucher:
@@ -457,28 +459,71 @@ class ForensicAgent:
457
459
  (cr_sobel_std >= 6.0 and ela_score >= 35.0 and has_isolated_cluster) or
458
460
  (sensor_noise_std < 1.15 and ela_score >= 30.0) or
459
461
  (harmonic_ratio >= 2.8 and fft_energy >= 85.0 and ela_score >= 38.0) or
460
- (ghost_discrepancy >= 0.82 and noise_divergence >= 35.0 and has_isolated_cluster) or
462
+ (ghost_discrepancy >= 1.25 and noise_divergence >= 35.0 and has_isolated_cluster) or
461
463
  (is_feathered and has_isolated_cluster)
462
464
  )
463
465
  has_corroboration = (
464
466
  is_feathered or
465
- (ghost_discrepancy >= 0.8) or
466
- (noise_divergence >= 45.0 and ela_score >= 25.0) or
467
- (ela_score >= 68.0) or
467
+ (ghost_discrepancy >= 1.25 and ela_score >= 30.0) or
468
+ (noise_divergence >= 45.0 and ela_score >= 35.0) or
468
469
  is_generative_ai or
469
470
  provenance.get("is_edited_software_flag", False)
470
471
  )
471
472
  else:
473
+ # Natural camera scenes: Corroboration strictly requires orthogonal physical concurrence.
474
+ # Natural camera optical edges and high-contrast scene features produce elevated ELA scores
475
+ # that must NEVER be flagged as tampering unless physically corroborated by independent probes.
476
+ has_ghost_mismatch = (
477
+ (abs(ghost_meta.get("optimal_roi_quality", 0) - ghost_meta.get("optimal_bg_quality", 0)) >= 4) or
478
+ (ghost_discrepancy >= 1.60 and chrom_diff >= 45.0)
479
+ )
480
+ pillar_ghost = (has_ghost_mismatch and ela_score >= 30.0 and has_isolated_cluster)
481
+
482
+ # Seam boundary feathering requires concurrence with compression or noise divergence
483
+ # (prevents high-contrast organic edges with 0 ghost from falsely triggering)
484
+ pillar_seam = (
485
+ is_feathered and
486
+ (has_ghost_mismatch or ghost_discrepancy >= 0.70 or noise_divergence >= 60.0 or sensor_noise_std < 1.15) and
487
+ has_isolated_cluster
488
+ )
489
+
490
+ # Sensor noise divergence: requires corroborating physical void, ghost mismatch, or seam
491
+ pillar_noise = (
492
+ noise_divergence >= 50.0 and
493
+ (has_ghost_mismatch or (is_feathered and ghost_discrepancy >= 0.70) or sensor_noise_std < 1.15) and
494
+ has_isolated_cluster
495
+ )
496
+
497
+ # High-noise inpainting concurrence (e.g. broken phone screens, spliced textures):
498
+ # Strong noise divergence (>= 80%) corroborated by elevated ghost discrepancy (>= 1.20)
499
+ # and significant chrominance shift (>= 18.0%) on isolated physical regions
500
+ pillar_ghost_noise = (
501
+ (
502
+ (has_ghost_mismatch and noise_divergence >= 35.0) or
503
+ (ghost_discrepancy >= 1.20 and noise_divergence >= 80.0 and ela_score >= 45.0 and chrom_diff >= 18.0 and (rw >= 45 and rh >= 45))
504
+ )
505
+ and has_isolated_cluster
506
+ )
507
+
508
+ # Spectral diffusion lattice harmonics
509
+ pillar_spectral = (harmonic_ratio >= 2.6 and fft_energy >= 82.0 and has_isolated_cluster)
510
+
511
+ # Sensor noise void (AI generated flat pixel patches)
512
+ pillar_sensor_void = (sensor_noise_std < 1.15 and noise_divergence >= 30.0 and ela_score >= 26.0 and has_isolated_cluster)
513
+
472
514
  is_generative_ai = (
473
- (has_isolated_cluster and is_feathered and ela_score >= 35.0) or
474
- (has_isolated_cluster and sensor_noise_std < 1.15 and noise_divergence >= 35.0 and ela_score >= 30.0) or
475
- (harmonic_ratio >= 2.8 and fft_energy >= 85.0 and is_feathered) or
476
- (has_isolated_cluster and is_feathered and (ghost_discrepancy >= 0.82 or noise_divergence >= 40.0))
515
+ pillar_spectral or
516
+ pillar_seam or
517
+ pillar_sensor_void or
518
+ (pillar_noise and (has_ghost_mismatch or is_feathered))
477
519
  )
478
520
  has_corroboration = (
479
- is_feathered or
480
- (ghost_discrepancy >= 0.82 and has_isolated_cluster and is_feathered) or
481
- (noise_divergence >= 45.0 and ela_score >= 35.0 and has_isolated_cluster and is_feathered) or
521
+ pillar_seam or
522
+ pillar_ghost or
523
+ pillar_noise or
524
+ pillar_ghost_noise or
525
+ pillar_spectral or
526
+ pillar_sensor_void or
482
527
  is_generative_ai or
483
528
  provenance.get("is_edited_software_flag", False)
484
529
  )
@@ -509,7 +554,7 @@ class ForensicAgent:
509
554
 
510
555
  noise_contrib = max(0.0, (noise_divergence - 70.0) * 0.35) if (has_isolated_cluster and has_corroboration) else 0.0
511
556
  ghost_contrib = max(0.0, (ghost_discrepancy - 0.8) * 6.0) if (has_isolated_cluster and has_corroboration) else 0.0
512
- seam_contrib = 25.0 if (is_feathered and has_isolated_cluster) else 0.0
557
+ seam_contrib = 25.0 if (has_corroboration and is_feathered and has_isolated_cluster) else 0.0
513
558
  software_contrib = 35.0 if provenance.get("is_edited_software_flag") else 0.0
514
559
 
515
560
  # Sensitivity modifier
@@ -173,6 +173,33 @@ def tool_global_ela_scan(img: np.ndarray, quality: int = 90) -> Tuple[np.ndarray
173
173
 
174
174
  # Prioritize genuine interior content anomalies over peripheral screenshot/crop frame borders
175
175
  pool = interior_candidates if interior_candidates else all_candidates
176
+
177
+ # If no candidate was isolated (e.g. background fused into full-frame blob),
178
+ # run a second pass with a higher selective percentile threshold to isolate the peak core
179
+ if not pool:
180
+ dyn_thresh_high = max(28, int(p95 * 0.88))
181
+ _, thresh_high = cv2.threshold(blurred, dyn_thresh_high, 255, cv2.THRESH_BINARY)
182
+ closed_high = cv2.morphologyEx(thresh_high, cv2.MORPH_CLOSE, kernel)
183
+ contours_high, _ = cv2.findContours(closed_high, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
184
+ for cnt in contours_high:
185
+ area = cv2.contourArea(cnt)
186
+ if area < min_area_thresh:
187
+ continue
188
+ x, y, cw, ch = cv2.boundingRect(cnt)
189
+ if (cw > 0.70 * w and ch > 0.70 * h) or area > 0.45 * total_frame_area:
190
+ continue
191
+ mask_cnt = np.zeros(blurred.shape, dtype=np.uint8)
192
+ cv2.drawContours(mask_cnt, [cnt], -1, 255, -1)
193
+ cnt_p95 = float(np.percentile(blurred[mask_cnt > 0], 95)) if np.any(mask_cnt > 0) else 0.0
194
+ score = cnt_p95 * np.log10(area + 10.0)
195
+ is_border = (x <= margin_x) or (y <= margin_y) or (x + cw >= w - margin_x) or (y + ch >= h - margin_y)
196
+ cand = (score, x, y, cw, ch)
197
+ all_candidates.append(cand)
198
+ if not is_border:
199
+ interior_candidates.append(cand)
200
+ pool = interior_candidates if interior_candidates else all_candidates
201
+
202
+ cluster_isolated = bool(pool)
176
203
  if pool:
177
204
  pool.sort(key=lambda item: item[0], reverse=True)
178
205
  score, x, y, cw, ch = pool[0]
@@ -197,7 +224,8 @@ def tool_global_ela_scan(img: np.ndarray, quality: int = 90) -> Tuple[np.ndarray
197
224
  return ela_heatmap, suspect_roi, round(anomaly_score, 2), {
198
225
  "roi": suspect_roi,
199
226
  "ela_p95_score": round(anomaly_score, 2),
200
- "clusters_detected": len(contours),
227
+ "clusters_detected": len(pool) if pool else len(contours),
228
+ "has_isolated_cluster": cluster_isolated,
201
229
  "dyn_thresh_used": dyn_thresh,
202
230
  "edge_compensation_active": True,
203
231
  "latency_ms": elapsed_ms
@@ -600,7 +628,8 @@ def tool_micro_roi_seam_inspection(img: np.ndarray, roi: List[int]) -> Dict[str,
600
628
  interior_std = float(np.std(lap_mag[interior_mask > 0])) if np.sum(interior_mask) > 0 else 1.0
601
629
 
602
630
  ratio = round(seam_std / max(interior_std, 0.01), 2)
603
- is_feathered = ratio > 1.85 or ratio < 0.35
631
+ # Generative AI inpainting feathering produces elevated Laplacian boundary variance discontinuity along the perimeter seam
632
+ is_feathered = ratio > 1.85
604
633
 
605
634
  # Overlay glowing border and heatmap on super-resolved crop
606
635
  colored_lap = cv2.applyColorMap(lap_mag, cv2.COLORMAP_MAGMA)
@@ -0,0 +1,292 @@
1
+ """
2
+ VeriSight MCP - Real-Life Forensic Sample Generator
3
+ Generates realistic real-world photos with genuine camera sensor noise, optical textures,
4
+ and authentic generative AI inpainting artifacts for competition demonstration.
5
+ """
6
+
7
+ import cv2
8
+ import numpy as np
9
+ import os
10
+
11
+ OUTPUT_DIR = os.path.dirname(__file__)
12
+
13
+ def generate_strawberry_mold_claim():
14
+ """Real-world Quick-Commerce case: Fresh strawberries with AI-inpainted rotten fungal patch."""
15
+ w, h = 800, 600
16
+ img = np.full((h, w, 3), (180, 205, 220), dtype=np.uint8)
17
+ rng = np.random.default_rng(2026)
18
+
19
+ grain = rng.normal(0, 5, img.shape).astype(np.int16)
20
+ img = np.clip(img.astype(np.int16) + grain, 0, 255).astype(np.uint8)
21
+
22
+ cv2.rectangle(img, (140, 80), (660, 520), (160, 185, 200), 2)
23
+ cv2.putText(img, "BLINKIT FRESH - LOT #90412 (FRESH STRAWBERRIES 250G)", (160, 115),
24
+ cv2.FONT_HERSHEY_SIMPLEX, 0.55, (80, 100, 120), 2)
25
+
26
+ centers = [(280, 260), (420, 240), (520, 300), (340, 380), (480, 400)]
27
+ for cx, cy in centers:
28
+ cv2.ellipse(img, (cx, cy), (65, 80), 15, 0, 360, (25, 30, 205), -1)
29
+ for sx in range(cx - 45, cx + 45, 14):
30
+ for sy in range(cy - 55, cy + 55, 14):
31
+ if ((sx - cx)/45)**2 + ((sy - cy)/55)**2 < 0.8:
32
+ cv2.circle(img, (sx + int(rng.integers(-2, 3)), sy), 2, (60, 180, 240), -1)
33
+ cv2.circle(img, (cx, cy - 70), 18, (45, 145, 55), -1)
34
+
35
+ base_path = os.path.join(OUTPUT_DIR, "real_strawberries_base.jpg")
36
+ cv2.imwrite(base_path, img, [int(cv2.IMWRITE_JPEG_QUALITY), 85])
37
+
38
+ tampered = cv2.imread(base_path)
39
+ rx, ry, rw, rh = 360, 200, 180, 160
40
+ patch = tampered[ry:ry+rh, rx:rx+rw].copy()
41
+
42
+ cv2.ellipse(patch, (90, 80), (60, 50), -10, 0, 360, (75, 95, 85), -1)
43
+ cv2.ellipse(patch, (90, 80), (40, 32), -10, 0, 360, (140, 160, 150), -1)
44
+
45
+ y_g, x_g = np.indices((rh, rw))
46
+ grid = ((np.sin(x_g * 0.5) * np.cos(y_g * 0.5)) * 16).astype(np.int16)
47
+ patch[:, :, 0] = np.clip(patch[:, :, 0].astype(np.int16) + grid, 0, 255).astype(np.uint8)
48
+ patch[:, :, 1] = np.clip(patch[:, :, 1].astype(np.int16) + grid, 0, 255).astype(np.uint8)
49
+
50
+ mask = np.zeros((rh, rw), dtype=np.float32)
51
+ cv2.ellipse(mask, (90, 80), (68, 56), -10, 0, 360, 1.0, -1)
52
+ mask = cv2.GaussianBlur(mask, (21, 21), 0)[:, :, np.newaxis]
53
+
54
+ blended = (patch * mask + tampered[ry:ry+rh, rx:rx+rw] * (1.0 - mask)).astype(np.uint8)
55
+ tampered[ry:ry+rh, rx:rx+rw] = blended
56
+
57
+ final_path = os.path.join(OUTPUT_DIR, "sample_real_strawberries_inpainted.jpg")
58
+ cv2.imwrite(final_path, tampered, [int(cv2.IMWRITE_JPEG_QUALITY), 98])
59
+ print(f"Generated: {final_path}")
60
+
61
+ def generate_invoice_tampering_claim():
62
+ """Real-world Receipt case: Delivery receipt with inpainted fake date & inflated refund amount."""
63
+ w, h = 800, 600
64
+ img = np.full((h, w, 3), (242, 246, 248), dtype=np.uint8)
65
+ rng = np.random.default_rng(404)
66
+ paper_texture = rng.normal(0, 3, img.shape).astype(np.int16)
67
+ img = np.clip(img.astype(np.int16) + paper_texture, 0, 255).astype(np.uint8)
68
+
69
+ cv2.rectangle(img, (180, 40), (620, 560), (200, 210, 215), 2)
70
+ cv2.putText(img, "ZEPTO HYPERLOCAL - TAX INVOICE", (210, 85), cv2.FONT_HERSHEY_SIMPLEX, 0.65, (30, 40, 50), 2)
71
+ cv2.line(img, (200, 105), (600, 105), (180, 190, 200), 2)
72
+
73
+ cv2.putText(img, "ORDER ID: ZEP-994102-OCT", (210, 140), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (60, 70, 80), 1)
74
+ cv2.putText(img, "DATE: 2026-10-18 19:42 IST", (210, 170), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (60, 70, 80), 1)
75
+ cv2.putText(img, "CUSTOMER: Rahul Sharma", (210, 200), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (60, 70, 80), 1)
76
+ cv2.line(img, (200, 220), (600, 220), (180, 190, 200), 1)
77
+
78
+ items = [
79
+ ("1x Organic Alphonso Mangoes", "Rs 650.00"),
80
+ ("2x Artisanal Greek Yogurt", "Rs 280.00"),
81
+ ("1x Cold Pressed Olive Oil", "Rs 520.00"),
82
+ ("Delivery & Platform Fee", "Rs 45.00")
83
+ ]
84
+ y_pos = 260
85
+ for name, price in items:
86
+ cv2.putText(img, name, (210, y_pos), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (50, 60, 70), 1)
87
+ cv2.putText(img, price, (500, y_pos), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (50, 60, 70), 1)
88
+ y_pos += 35
89
+
90
+ cv2.line(img, (200, y_pos + 10), (600, y_pos + 10), (180, 190, 200), 2)
91
+ cv2.putText(img, "TOTAL AMOUNT: Rs 1,495.00", (210, y_pos + 45), cv2.FONT_HERSHEY_SIMPLEX, 0.65, (20, 30, 40), 2)
92
+
93
+ base_path = os.path.join(OUTPUT_DIR, "real_invoice_base.jpg")
94
+ cv2.imwrite(base_path, img, [int(cv2.IMWRITE_JPEG_QUALITY), 84])
95
+
96
+ tampered = cv2.imread(base_path)
97
+ rx, ry, rw, rh = 380, y_pos + 15, 210, 50
98
+ patch = tampered[ry:ry+rh, rx:rx+rw].copy()
99
+
100
+ cv2.rectangle(patch, (10, 5), (195, 42), (242, 246, 248), -1)
101
+ cv2.putText(patch, "Rs 5,980.00", (15, 32), cv2.FONT_HERSHEY_SIMPLEX, 0.72, (20, 25, 35), 2)
102
+
103
+ noise = rng.normal(0, 1.2, patch.shape).astype(np.int16)
104
+ patch = np.clip(patch.astype(np.int16) + noise, 0, 255).astype(np.uint8)
105
+ tampered[ry:ry+rh, rx:rx+rw] = patch
106
+
107
+ final_path = os.path.join(OUTPUT_DIR, "sample_real_invoice_tampered.jpg")
108
+ cv2.imwrite(final_path, tampered, [int(cv2.IMWRITE_JPEG_QUALITY), 97])
109
+ print(f"Generated: {final_path}")
110
+
111
+ def generate_car_bumper_dent_claim():
112
+ """Real-world Auto Insurance case: Intact car bumper with generative AI dent/scratch."""
113
+ w, h = 800, 600
114
+ img = np.full((h, w, 3), (195, 205, 212), dtype=np.uint8)
115
+ cv2.ellipse(img, (400, 650), (450, 350), 0, 0, 180, (160, 175, 185), 6)
116
+ cv2.line(img, (50, 420), (750, 420), (145, 155, 165), 3)
117
+
118
+ cv2.rectangle(img, (310, 440), (490, 510), (235, 240, 245), -1)
119
+ cv2.rectangle(img, (310, 440), (490, 510), (30, 40, 50), 2)
120
+ cv2.putText(img, "DL 01 AB 8842", (325, 485), cv2.FONT_HERSHEY_SIMPLEX, 0.65, (20, 30, 40), 2)
121
+
122
+ base_path = os.path.join(OUTPUT_DIR, "real_car_base.jpg")
123
+ cv2.imwrite(base_path, img, [int(cv2.IMWRITE_JPEG_QUALITY), 86])
124
+
125
+ tampered = cv2.imread(base_path)
126
+ rx, ry, rw, rh = 180, 220, 180, 150
127
+ patch = tampered[ry:ry+rh, rx:rx+rw].copy()
128
+
129
+ cv2.ellipse(patch, (90, 75), (65, 45), -25, 0, 360, (70, 80, 88), -1)
130
+ cv2.ellipse(patch, (90, 75), (45, 30), -25, 0, 360, (40, 48, 55), -1)
131
+ cv2.line(patch, (40, 50), (140, 95), (25, 28, 30), 3)
132
+ cv2.line(patch, (55, 75), (120, 110), (25, 28, 30), 2)
133
+
134
+ y_g, x_g = np.indices((rh, rw))
135
+ grid = ((np.sin(x_g * 0.4) + np.cos(y_g * 0.4)) * 12).astype(np.int16)
136
+ patch[:, :, 0] = np.clip(patch[:, :, 0].astype(np.int16) + grid, 0, 255).astype(np.uint8)
137
+
138
+ tampered[ry:ry+rh, rx:rx+rw] = patch
139
+
140
+ final_path = os.path.join(OUTPUT_DIR, "sample_real_car_bumper_dent.jpg")
141
+ cv2.imwrite(final_path, tampered, [int(cv2.IMWRITE_JPEG_QUALITY), 98])
142
+ print(f"Generated: {final_path}")
143
+
144
+ def generate_puncture_box_claim():
145
+ """Real-world Logistics case: Crushed/punctured shipping carton claim."""
146
+ w, h = 800, 600
147
+ img = np.full((h, w, 3), (135, 170, 200), dtype=np.uint8)
148
+ rng = np.random.default_rng(101)
149
+ img = np.clip(img.astype(np.int16) + rng.normal(0, 4, img.shape).astype(np.int16), 0, 255).astype(np.uint8)
150
+ cv2.rectangle(img, (140, 80), (660, 520), (105, 140, 170), 3)
151
+ cv2.putText(img, "AMAZON LOGISTICS - AIRWAY BILL #99214", (160, 120), cv2.FONT_HERSHEY_SIMPLEX, 0.55, (60, 80, 100), 2)
152
+
153
+ base_path = os.path.join(OUTPUT_DIR, "real_box_base.jpg")
154
+ cv2.imwrite(base_path, img, [int(cv2.IMWRITE_JPEG_QUALITY), 84])
155
+
156
+ tampered = cv2.imread(base_path)
157
+ rx, ry, rw, rh = 320, 240, 180, 160
158
+ patch = tampered[ry:ry+rh, rx:rx+rw].copy()
159
+ cv2.ellipse(patch, (90, 80), (55, 45), 20, 0, 360, (25, 30, 35), -1)
160
+ cv2.ellipse(patch, (90, 80), (65, 55), 20, 0, 360, (80, 110, 135), 4)
161
+ y_g, x_g = np.indices((rh, rw))
162
+ grid = ((np.sin(x_g * 0.45) * np.cos(y_g * 0.45)) * 16).astype(np.int16)
163
+ patch[:, :, 0] = np.clip(patch[:, :, 0].astype(np.int16) + grid, 0, 255).astype(np.uint8)
164
+ mask = np.zeros((rh, rw), dtype=np.float32)
165
+ cv2.ellipse(mask, (90, 80), (68, 58), 20, 0, 360, 1.0, -1)
166
+ mask = cv2.GaussianBlur(mask, (15, 15), 0)[:, :, np.newaxis]
167
+ tampered[ry:ry+rh, rx:rx+rw] = (patch * mask + tampered[ry:ry+rh, rx:rx+rw] * (1.0 - mask)).astype(np.uint8)
168
+
169
+ final_path = os.path.join(OUTPUT_DIR, "sample_real_delivery_box_puncture.jpg")
170
+ cv2.imwrite(final_path, tampered, [int(cv2.IMWRITE_JPEG_QUALITY), 98])
171
+ print(f"Generated: {final_path}")
172
+
173
+ def generate_windshield_crack_claim():
174
+ """Real-world Auto Glass case: Inpainted bullseye impact crack on car windshield."""
175
+ w, h = 800, 600
176
+ img = np.full((h, w, 3), (120, 135, 140), dtype=np.uint8)
177
+ cv2.line(img, (100, 500), (700, 500), (40, 45, 50), 6)
178
+
179
+ base_path = os.path.join(OUTPUT_DIR, "real_windshield_base.jpg")
180
+ cv2.imwrite(base_path, img, [int(cv2.IMWRITE_JPEG_QUALITY), 85])
181
+
182
+ tampered = cv2.imread(base_path)
183
+ rx, ry, rw, rh = 300, 180, 200, 180
184
+ patch = tampered[ry:ry+rh, rx:rx+rw].copy()
185
+ cv2.circle(patch, (100, 90), 18, (230, 240, 245), -1)
186
+ for angle in np.linspace(0, 2*np.pi, 10, endpoint=False):
187
+ x2 = int(100 + 85 * np.cos(angle))
188
+ y2 = int(90 + 85 * np.sin(angle))
189
+ cv2.line(patch, (100, 90), (x2, y2), (210, 225, 235), 2)
190
+ y_g, x_g = np.indices((rh, rw))
191
+ grid = ((np.sin(x_g * 0.45) * np.cos(y_g * 0.45)) * 16).astype(np.int16)
192
+ patch[:, :, 0] = np.clip(patch[:, :, 0].astype(np.int16) + grid, 0, 255).astype(np.uint8)
193
+ mask = np.zeros((rh, rw), dtype=np.float32)
194
+ cv2.ellipse(mask, (100, 90), (90, 80), 0, 0, 360, 1.0, -1)
195
+ mask = cv2.GaussianBlur(mask, (15, 15), 0)[:, :, np.newaxis]
196
+ tampered[ry:ry+rh, rx:rx+rw] = (patch * mask + tampered[ry:ry+rh, rx:rx+rw] * (1.0 - mask)).astype(np.uint8)
197
+
198
+ final_path = os.path.join(OUTPUT_DIR, "sample_real_cracked_windshield.jpg")
199
+ cv2.imwrite(final_path, tampered, [int(cv2.IMWRITE_JPEG_QUALITY), 98])
200
+ print(f"Generated: {final_path}")
201
+
202
+ def generate_spoiled_milk_claim():
203
+ """Real-world Dairy Grocery case: Inpainted curdled green mold in milk carton."""
204
+ w, h = 800, 600
205
+ img = np.full((h, w, 3), (210, 215, 220), dtype=np.uint8)
206
+ cv2.rectangle(img, (260, 100), (540, 520), (180, 190, 200), 2)
207
+ cv2.putText(img, "AMUL TAZA TONED MILK 1L", (280, 150), cv2.FONT_HERSHEY_SIMPLEX, 0.55, (50, 70, 90), 2)
208
+
209
+ base_path = os.path.join(OUTPUT_DIR, "real_milk_base.jpg")
210
+ cv2.imwrite(base_path, img, [int(cv2.IMWRITE_JPEG_QUALITY), 85])
211
+
212
+ tampered = cv2.imread(base_path)
213
+ rx, ry, rw, rh = 300, 240, 200, 180
214
+ patch = tampered[ry:ry+rh, rx:rx+rw].copy()
215
+ cv2.ellipse(patch, (100, 90), (60, 50), -15, 0, 360, (50, 90, 70), -1)
216
+ cv2.ellipse(patch, (100, 90), (40, 30), -15, 0, 360, (90, 140, 110), -1)
217
+ y_g, x_g = np.indices((rh, rw))
218
+ grid = ((np.sin(x_g * 0.45) * np.cos(y_g * 0.45)) * 16).astype(np.int16)
219
+ patch[:, :, 0] = np.clip(patch[:, :, 0].astype(np.int16) + grid, 0, 255).astype(np.uint8)
220
+ mask = np.zeros((rh, rw), dtype=np.float32)
221
+ cv2.ellipse(mask, (100, 90), (70, 60), -15, 0, 360, 1.0, -1)
222
+ mask = cv2.GaussianBlur(mask, (15, 15), 0)[:, :, np.newaxis]
223
+ tampered[ry:ry+rh, rx:rx+rw] = (patch * mask + tampered[ry:ry+rh, rx:rx+rw] * (1.0 - mask)).astype(np.uint8)
224
+
225
+ final_path = os.path.join(OUTPUT_DIR, "sample_real_spoiled_milk_mold.jpg")
226
+ cv2.imwrite(final_path, tampered, [int(cv2.IMWRITE_JPEG_QUALITY), 98])
227
+ print(f"Generated: {final_path}")
228
+
229
+ def generate_prescription_alteration_claim():
230
+ """Real-world Medical Claim case: Digitally altered prescription dosage quantity."""
231
+ w, h = 800, 600
232
+ img = np.full((h, w, 3), (245, 248, 250), dtype=np.uint8)
233
+ cv2.rectangle(img, (180, 50), (620, 550), (210, 220, 225), 2)
234
+ cv2.putText(img, "APOLLO HOSPITALS - OUTPATIENT RX", (210, 95), cv2.FONT_HERSHEY_SIMPLEX, 0.65, (40, 50, 60), 2)
235
+ cv2.line(img, (200, 115), (600, 115), (180, 190, 200), 2)
236
+ cv2.putText(img, "PATIENT: Ananya Gupta", (210, 150), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (60, 70, 80), 1)
237
+ cv2.putText(img, "1. Amoxicillin 500mg - Qty: 10 Tabs", (210, 220), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (40, 50, 60), 1)
238
+ cv2.putText(img, "2. Paracetamol 650mg - Qty: 15 Tabs", (210, 270), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (40, 50, 60), 1)
239
+ cv2.putText(img, "TOTAL PHARMACY BILL: Rs 480.00", (210, 360), cv2.FONT_HERSHEY_SIMPLEX, 0.65, (30, 40, 50), 2)
240
+
241
+ base_path = os.path.join(OUTPUT_DIR, "real_rx_base.jpg")
242
+ cv2.imwrite(base_path, img, [int(cv2.IMWRITE_JPEG_QUALITY), 84])
243
+
244
+ tampered = cv2.imread(base_path)
245
+ rx, ry, rw, rh = 440, 330, 160, 45
246
+ patch = tampered[ry:ry+rh, rx:rx+rw].copy()
247
+ cv2.rectangle(patch, (5, 5), (150, 40), (245, 248, 250), -1)
248
+ cv2.putText(patch, "Rs 2,480.00", (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.65, (20, 25, 30), 2)
249
+ tampered[ry:ry+rh, rx:rx+rw] = patch
250
+
251
+ final_path = os.path.join(OUTPUT_DIR, "sample_real_altered_prescription.jpg")
252
+ cv2.imwrite(final_path, tampered, [int(cv2.IMWRITE_JPEG_QUALITY), 97])
253
+ print(f"Generated: {final_path}")
254
+
255
+ def generate_broken_phone_screen_claim():
256
+ """Real-world Electronics Warranty case: Inpainted shattered spiderweb crack on OLED screen."""
257
+ w, h = 800, 600
258
+ img = np.full((h, w, 3), (35, 40, 42), dtype=np.uint8)
259
+ cv2.rectangle(img, (220, 50), (580, 550), (15, 18, 20), -1)
260
+ cv2.rectangle(img, (240, 80), (560, 520), (50, 75, 95), -1)
261
+ cv2.putText(img, "12:45", (350, 150), cv2.FONT_HERSHEY_SIMPLEX, 1.2, (220, 230, 240), 2)
262
+
263
+ base_path = os.path.join(OUTPUT_DIR, "real_phone_base.jpg")
264
+ cv2.imwrite(base_path, img, [int(cv2.IMWRITE_JPEG_QUALITY), 84])
265
+
266
+ tampered = cv2.imread(base_path)
267
+ rx, ry, rw, rh = 280, 200, 240, 220
268
+ patch = tampered[ry:ry+rh, rx:rx+rw].copy()
269
+ cv2.circle(patch, (120, 110), 12, (240, 245, 255), -1)
270
+ for angle in np.linspace(0, 2*np.pi, 8, endpoint=False):
271
+ x2 = int(120 + 95 * np.cos(angle))
272
+ y2 = int(110 + 95 * np.sin(angle))
273
+ cv2.line(patch, (120, 110), (x2, y2), (220, 230, 245), 2)
274
+ y_g, x_g = np.indices((rh, rw))
275
+ grid = (np.sin(x_g * 0.45) * 18).astype(np.int16)
276
+ patch[:, :, 0] = np.clip(patch[:, :, 0].astype(np.int16) + grid, 0, 255).astype(np.uint8)
277
+ tampered[ry:ry+rh, rx:rx+rw] = patch
278
+
279
+ final_path = os.path.join(OUTPUT_DIR, "sample_real_broken_screen_phone.jpg")
280
+ cv2.imwrite(final_path, tampered, [int(cv2.IMWRITE_JPEG_QUALITY), 98])
281
+ print(f"Generated: {final_path}")
282
+
283
+ if __name__ == "__main__":
284
+ generate_strawberry_mold_claim()
285
+ generate_invoice_tampering_claim()
286
+ generate_car_bumper_dent_claim()
287
+ generate_puncture_box_claim()
288
+ generate_windshield_crack_claim()
289
+ generate_spoiled_milk_claim()
290
+ generate_prescription_alteration_claim()
291
+ generate_broken_phone_screen_claim()
292
+ print("All 8 real-life forensic samples successfully created!")
@@ -31,7 +31,7 @@ from mcp_server import MCP_TOOLS_MANIFEST, handle_json_rpc
31
31
  app = FastAPI(
32
32
  title="VeriSight MCP - OpenCV 5 Agentic Forensics Engine",
33
33
  description="Multi-spectral forensic vision agent powered by OpenCV 5 on AWS Graviton Arm64",
34
- version="2.2.3"
34
+ version="2.2.5"
35
35
  )
36
36
 
37
37
  app.add_middleware(
@@ -47,7 +47,7 @@ def root_status():
47
47
  return {
48
48
  "service": "VeriSight MCP - Autonomous Physical AI Forensics Engine",
49
49
  "status": "ONLINE",
50
- "version": "2.2.3",
50
+ "version": "2.2.5",
51
51
  "engine": "OpenCV 5.0.0 (ARM64 SIMD)",
52
52
  "docs_url": "/docs",
53
53
  "api_url": "/api",
@@ -56,7 +56,7 @@ def root_status():
56
56
 
57
57
  @app.get("/health")
58
58
  def health_check():
59
- return {"status": "healthy", "service": "verisight-backend", "version": "2.2.3"}
59
+ return {"status": "healthy", "service": "verisight-backend", "version": "2.2.5"}
60
60
 
61
61
  @app.get("/api")
62
62
  @app.get("/api/")
@@ -64,7 +64,7 @@ def api_index():
64
64
  return {
65
65
  "service": "VeriSight MCP REST API",
66
66
  "status": "ONLINE",
67
- "version": "2.2.3",
67
+ "version": "2.2.5",
68
68
  "documentation": "/docs",
69
69
  "endpoints": {
70
70
  "health": "/health",
@@ -251,7 +251,7 @@ def handle_json_rpc(payload: Dict[str, Any], agent_pipeline_callback) -> Optiona
251
251
  },
252
252
  "serverInfo": {
253
253
  "name": "verisight-mcp-engine",
254
- "version": "2.2.3"
254
+ "version": "2.2.5"
255
255
  }
256
256
  }
257
257
  }
@@ -268,7 +268,7 @@ def handle_json_rpc(payload: Dict[str, Any], agent_pipeline_callback) -> Optiona
268
268
  "protocol_version": "2024-11-05",
269
269
  "server_info": {
270
270
  "name": "verisight-mcp-engine",
271
- "version": "2.2.3",
271
+ "version": "2.2.5",
272
272
  "capabilities": {"tools": True, "resources": False, "prompts": False}
273
273
  }
274
274
  }
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "verisight"
7
- version = "2.2.3"
7
+ version = "2.2.5"
8
8
  authors = [
9
9
  { name="Aditya Raj Tiwari", email="adityasantosh2026@gmail.com" },
10
10
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: verisight
3
- Version: 2.2.3
3
+ Version: 2.2.5
4
4
  Summary: Sub-3ms Physical Multi-Spectral Image Forensics & Presentation Attack Detection engine powered by OpenCV 5 and Model Context Protocol (MCP).
5
5
  Author-email: Aditya Raj Tiwari <adityasantosh2026@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -35,6 +35,7 @@ Dynamic: license-file
35
35
 
36
36
  [![VeriSight CI](https://github.com/Adityarajtiwari880/verisight/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Adityarajtiwari880/verisight/actions/workflows/ci.yml)
37
37
  [![PyPI version](https://img.shields.io/pypi/v/verisight.svg?color=blue)](https://pypi.org/project/verisight/)
38
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Adityarajtiwari880/verisight/blob/main/benchmarks/verisight_forensic_benchmark.ipynb)
38
39
  [![mcprush score](https://mcprush.com/badge/verisight-mcp/score.svg)](https://mcprush.com/to/verisight-mcp?ref=badge)
39
40
  [![M8ven Score](https://m8ven.ai/badge/mcp/adityarajtiwari880-verisight-11ohzr?v=5ddb567da1a0cb2e2f12567300d7ff24)](https://m8ven.ai/mcp/adityarajtiwari880-verisight-11ohzr?s=readme)
40
41
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
@@ -289,6 +290,19 @@ Executing 100 continuous perception-decision pipeline frames...
289
290
 
290
291
  ---
291
292
 
293
+ ### 🧪 1-Click Cloud Benchmark Suite (Zero Local Disk Space)
294
+
295
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Adityarajtiwari880/verisight/blob/main/benchmarks/verisight_forensic_benchmark.ipynb)
296
+
297
+ Evaluate VeriSight against real-world camera photographs, spliced manipulations, and generative AI inpaintings directly in the cloud with **0 KB local disk usage**:
298
+
299
+ * **Interactive Notebook:** [`benchmarks/verisight_forensic_benchmark.ipynb`](benchmarks/verisight_forensic_benchmark.ipynb)
300
+ * **Headless Evaluation Script:** [`benchmarks/run_colab_benchmark.py`](benchmarks/run_colab_benchmark.py)
301
+ * **Streaming Architecture:** Images are fetched in-memory (`RAM-only`) from standard vision corpuses (COCO, Open Images, OpenCV test suites) and evaluated on-the-fly without saving any image files to disk.
302
+ * **Metrics Generated:** Confusion Matrix, Precision, Recall, Specificity, F1-Score, Processing Latency, and ROC Curve.
303
+
304
+ ---
305
+
292
306
  ## 📁 Repository Structure
293
307
 
294
308
  ```
@@ -297,6 +311,9 @@ verisight/
297
311
  │ ├── workflows/ci.yml # Automated Python 3.11 & Next.js CI
298
312
  │ ├── ISSUE_TEMPLATE/ # Bug reports & feature requests
299
313
  │ └── PULL_REQUEST_TEMPLATE.md # Contributor review standards
314
+ ├── benchmarks/ # 1-Click cloud benchmark suite (Colab / RAM streaming)
315
+ │ ├── run_colab_benchmark.py # Headless streaming evaluator
316
+ │ └── verisight_forensic_benchmark.ipynb # Interactive notebook with confusion heatmaps
300
317
  ├── backend/
301
318
  │ ├── __init__.py # Python SDK exports (scan_image, verify_claim)
302
319
  │ ├── cli.py # Terminal CLI entry point (verisight command)
@@ -1,175 +0,0 @@
1
- """
2
- VeriSight MCP - Real-Life Forensic Sample Generator
3
- Generates realistic real-world photos with genuine camera sensor noise, optical textures,
4
- and authentic generative AI inpainting artifacts for competition demonstration.
5
- """
6
-
7
- import cv2
8
- import numpy as np
9
- import os
10
-
11
- OUTPUT_DIR = os.path.dirname(__file__)
12
-
13
- def generate_strawberry_mold_claim():
14
- """Real-world Quick-Commerce case: Fresh strawberries with AI-inpainted rotten fungal patch."""
15
- w, h = 800, 600
16
- # Realistic background: kitchen counter / cutting board texture
17
- img = np.full((h, w, 3), (180, 205, 220), dtype=np.uint8) # Marble counter tone
18
- rng = np.random.default_rng(2026)
19
-
20
- # Natural counter grain and reflections
21
- grain = rng.normal(0, 5, img.shape).astype(np.int16)
22
- img = np.clip(img.astype(np.int16) + grain, 0, 255).astype(np.uint8)
23
-
24
- # Clear plastic container
25
- cv2.rectangle(img, (140, 80), (660, 520), (160, 185, 200), 2)
26
- cv2.putText(img, "BLINKIT FRESH - LOT #90412 (FRESH STRAWBERRIES 250G)", (160, 115),
27
- cv2.FONT_HERSHEY_SIMPLEX, 0.55, (80, 100, 120), 2)
28
-
29
- # Draw several realistic red strawberries with seed texture
30
- centers = [(280, 260), (420, 240), (520, 300), (340, 380), (480, 400)]
31
- for cx, cy in centers:
32
- # Strawberry body
33
- cv2.ellipse(img, (cx, cy), (65, 80), 15, 0, 360, (25, 30, 205), -1)
34
- # Seeds
35
- for sx in range(cx - 45, cx + 45, 14):
36
- for sy in range(cy - 55, cy + 55, 14):
37
- if ((sx - cx)/45)**2 + ((sy - cy)/55)**2 < 0.8:
38
- cv2.circle(img, (sx + int(rng.integers(-2, 3)), sy), 2, (60, 180, 240), -1)
39
- # Green leafy crown
40
- cv2.circle(img, (cx, cy - 70), 18, (45, 145, 55), -1)
41
-
42
- # Save realistic base at organic camera quality Q=85
43
- base_path = os.path.join(OUTPUT_DIR, "real_strawberries_base.jpg")
44
- cv2.imwrite(base_path, img, [int(cv2.IMWRITE_JPEG_QUALITY), 85])
45
-
46
- # Now simulate Generative AI Inpainting:
47
- # A user takes an AI inpainting tool to add a disgusting rotting gray-white fungal mold patch
48
- tampered = cv2.imread(base_path)
49
- rx, ry, rw, rh = 360, 200, 180, 160
50
- patch = tampered[ry:ry+rh, rx:rx+rw].copy()
51
-
52
- # Mold spot with fuzzy fungal texture
53
- cv2.ellipse(patch, (90, 80), (60, 50), -10, 0, 360, (75, 95, 85), -1)
54
- cv2.ellipse(patch, (90, 80), (40, 32), -10, 0, 360, (140, 160, 150), -1)
55
-
56
- # Latent diffusion periodic upsampling grid (characteristic of conv/attention decoder layers)
57
- y_g, x_g = np.indices((rh, rw))
58
- grid = ((np.sin(x_g * 0.5) * np.cos(y_g * 0.5)) * 16).astype(np.int16)
59
- patch[:, :, 0] = np.clip(patch[:, :, 0].astype(np.int16) + grid, 0, 255).astype(np.uint8)
60
- patch[:, :, 1] = np.clip(patch[:, :, 1].astype(np.int16) + grid, 0, 255).astype(np.uint8)
61
-
62
- # Smooth blending around inpainting edge
63
- mask = np.zeros((rh, rw), dtype=np.float32)
64
- cv2.ellipse(mask, (90, 80), (68, 56), -10, 0, 360, 1.0, -1)
65
- mask = cv2.GaussianBlur(mask, (21, 21), 0)[:, :, np.newaxis]
66
-
67
- blended = (patch * mask + tampered[ry:ry+rh, rx:rx+rw] * (1.0 - mask)).astype(np.uint8)
68
- tampered[ry:ry+rh, rx:rx+rw] = blended
69
-
70
- # Save final image at Q=98 (creating the classic JPEG Ghost & ELA compression mismatch)
71
- final_path = os.path.join(OUTPUT_DIR, "sample_real_strawberries_inpainted.jpg")
72
- cv2.imwrite(final_path, tampered, [int(cv2.IMWRITE_JPEG_QUALITY), 98])
73
- print(f"Generated: {final_path}")
74
-
75
- def generate_invoice_tampering_claim():
76
- """Real-world Receipt case: Delivery receipt with inpainted fake date & inflated refund amount."""
77
- w, h = 800, 600
78
- img = np.full((h, w, 3), (242, 246, 248), dtype=np.uint8) # Paper receipt color
79
- rng = np.random.default_rng(404)
80
- paper_texture = rng.normal(0, 3, img.shape).astype(np.int16)
81
- img = np.clip(img.astype(np.int16) + paper_texture, 0, 255).astype(np.uint8)
82
-
83
- # Receipt borders & header
84
- cv2.rectangle(img, (180, 40), (620, 560), (200, 210, 215), 2)
85
- cv2.putText(img, "ZEPTO HYPERLOCAL - TAX INVOICE", (210, 85), cv2.FONT_HERSHEY_SIMPLEX, 0.65, (30, 40, 50), 2)
86
- cv2.line(img, (200, 105), (600, 105), (180, 190, 200), 2)
87
-
88
- cv2.putText(img, "ORDER ID: ZEP-994102-OCT", (210, 140), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (60, 70, 80), 1)
89
- cv2.putText(img, "DATE: 2026-10-18 19:42 IST", (210, 170), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (60, 70, 80), 1)
90
- cv2.putText(img, "CUSTOMER: Rahul Sharma", (210, 200), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (60, 70, 80), 1)
91
- cv2.line(img, (200, 220), (600, 220), (180, 190, 200), 1)
92
-
93
- items = [
94
- ("1x Organic Alphonso Mangoes", "Rs 650.00"),
95
- ("2x Artisanal Greek Yogurt", "Rs 280.00"),
96
- ("1x Cold Pressed Olive Oil", "Rs 520.00"),
97
- ("Delivery & Platform Fee", "Rs 45.00")
98
- ]
99
- y_pos = 260
100
- for name, price in items:
101
- cv2.putText(img, name, (210, y_pos), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (50, 60, 70), 1)
102
- cv2.putText(img, price, (500, y_pos), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (50, 60, 70), 1)
103
- y_pos += 35
104
-
105
- cv2.line(img, (200, y_pos + 10), (600, y_pos + 10), (180, 190, 200), 2)
106
- cv2.putText(img, "TOTAL AMOUNT: Rs 1,495.00", (210, y_pos + 45), cv2.FONT_HERSHEY_SIMPLEX, 0.65, (20, 30, 40), 2)
107
-
108
- base_path = os.path.join(OUTPUT_DIR, "real_invoice_base.jpg")
109
- cv2.imwrite(base_path, img, [int(cv2.IMWRITE_JPEG_QUALITY), 84])
110
-
111
- # Tampering: inpaint over total to claim fraudulent 4x refund
112
- tampered = cv2.imread(base_path)
113
- rx, ry, rw, rh = 380, y_pos + 15, 210, 50
114
- patch = tampered[ry:ry+rh, rx:rx+rw].copy()
115
-
116
- # Erase original and write synthetic altered amount
117
- cv2.rectangle(patch, (10, 5), (195, 42), (242, 246, 248), -1)
118
- cv2.putText(patch, "Rs 5,980.00", (15, 32), cv2.FONT_HERSHEY_SIMPLEX, 0.72, (20, 25, 35), 2)
119
-
120
- # Add synthetic inpainting noise divergence
121
- noise = rng.normal(0, 1.2, patch.shape).astype(np.int16)
122
- patch = np.clip(patch.astype(np.int16) + noise, 0, 255).astype(np.uint8)
123
- tampered[ry:ry+rh, rx:rx+rw] = patch
124
-
125
- final_path = os.path.join(OUTPUT_DIR, "sample_real_invoice_tampered.jpg")
126
- cv2.imwrite(final_path, tampered, [int(cv2.IMWRITE_JPEG_QUALITY), 97])
127
- print(f"Generated: {final_path}")
128
-
129
- def generate_car_bumper_dent_claim():
130
- """Real-world Auto Insurance case: Intact car bumper with generative AI dent/scratch."""
131
- w, h = 800, 600
132
- # Metallic silver car paint
133
- img = np.full((h, w, 3), (195, 205, 212), dtype=np.uint8)
134
- rng = np.random.default_rng(777)
135
-
136
- # Car body contour lines and reflections
137
- cv2.ellipse(img, (400, 650), (450, 350), 0, 0, 180, (160, 175, 185), 6)
138
- cv2.line(img, (50, 420), (750, 420), (145, 155, 165), 3) # Bumper seam line
139
-
140
- # License plate
141
- cv2.rectangle(img, (310, 440), (490, 510), (235, 240, 245), -1)
142
- cv2.rectangle(img, (310, 440), (490, 510), (30, 40, 50), 2)
143
- cv2.putText(img, "DL 01 AB 8842", (325, 485), cv2.FONT_HERSHEY_SIMPLEX, 0.65, (20, 30, 40), 2)
144
-
145
- base_path = os.path.join(OUTPUT_DIR, "real_car_base.jpg")
146
- cv2.imwrite(base_path, img, [int(cv2.IMWRITE_JPEG_QUALITY), 86])
147
-
148
- # Tampering: inpaint an ugly deep collision dent & black paint scratch
149
- tampered = cv2.imread(base_path)
150
- rx, ry, rw, rh = 180, 220, 180, 150
151
- patch = tampered[ry:ry+rh, rx:rx+rw].copy()
152
-
153
- # Deep concave shadow dent
154
- cv2.ellipse(patch, (90, 75), (65, 45), -25, 0, 360, (70, 80, 88), -1)
155
- cv2.ellipse(patch, (90, 75), (45, 30), -25, 0, 360, (40, 48, 55), -1)
156
- # Paint gouge scratches
157
- cv2.line(patch, (40, 50), (140, 95), (25, 28, 30), 3)
158
- cv2.line(patch, (55, 75), (120, 110), (25, 28, 30), 2)
159
-
160
- # Upsampling grid harmonics
161
- y_g, x_g = np.indices((rh, rw))
162
- grid = ((np.sin(x_g * 0.4) + np.cos(y_g * 0.4)) * 12).astype(np.int16)
163
- patch[:, :, 0] = np.clip(patch[:, :, 0].astype(np.int16) + grid, 0, 255).astype(np.uint8)
164
-
165
- tampered[ry:ry+rh, rx:rx+rw] = patch
166
-
167
- final_path = os.path.join(OUTPUT_DIR, "sample_real_car_bumper_dent.jpg")
168
- cv2.imwrite(final_path, tampered, [int(cv2.IMWRITE_JPEG_QUALITY), 98])
169
- print(f"Generated: {final_path}")
170
-
171
- if __name__ == "__main__":
172
- generate_strawberry_mold_claim()
173
- generate_invoice_tampering_claim()
174
- generate_car_bumper_dent_claim()
175
- print("All real-life forensic samples successfully created!")
File without changes
File without changes
File without changes