Files
reTraining/backend/test.py
T
asus 5c7c122105 feat: add counting bench, triage, and dataset modules
This commit includes major additions and updates to the frontend and backend architectures, introducing new dataset management, live counting features, batch processing, and triage logic. Includes new UI pages, components, and API routes.
2026-08-14 16:28:52 +07:00

19 lines
584 B
Python

import json
from urllib import request
data = json.dumps({
"frame_id": 26, # Need a valid frame_id! Let's get one from the db
"engine": "sam3",
"threshold": 0.35,
"iou_threshold": 0.8,
"min_box_frac": 0.0,
"target_class_names": ["sack"]
}).encode('utf-8')
req = request.Request('http://localhost:8000/api/batches/5/preview', data=data, headers={'Content-Type': 'application/json'})
try:
with request.urlopen(req) as response:
print(response.read().decode('utf-8'))
except Exception as e:
print("Error:", getattr(e, 'read', lambda: str(e))())