-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api.py
More file actions
28 lines (22 loc) · 714 Bytes
/
Copy pathtest_api.py
File metadata and controls
28 lines (22 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import requests
from pathlib import Path
# Create simple test images if you don't have any
from PIL import Image
import io
# Option 1: Use dummy images
face_img = Image.new('RGB', (224, 224), color='blue')
sig_img = Image.new('L', (150, 220), color='white')
face_bytes = io.BytesIO()
face_img.save(face_bytes, format='PNG')
face_bytes.seek(0)
sig_bytes = io.BytesIO()
sig_img.save(sig_bytes, format='PNG')
sig_bytes.seek(0)
# Send to API
files = {
'face': ('face.png', face_bytes, 'image/png'),
'signature': ('signature.png', sig_bytes, 'image/png')
}
print("Testing API at http://localhost:8000/verify...")
response = requests.post('http://localhost:8000/verify', files=files)
print(response.json())