Update annotation class to make 'time' attribute public and enhance video time formatting in the main processing function. Adjust documentation to reflect changes in test batch progression.

This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-03-23 14:09:15 +02:00
parent 86d8e7e22d
commit e593f57884
3 changed files with 9 additions and 5 deletions
+5 -1
View File
@@ -177,10 +177,14 @@ def _post_annotation_to_service(token_mgr: TokenManager, media_id: str,
try:
token = token_mgr.get_valid_token()
image_b64 = base64.b64encode(annotation.image).decode() if annotation.image else None
total_seconds = annotation.time // 1000 if annotation.time else 0
hours = total_seconds // 3600
minutes = (total_seconds % 3600) // 60
seconds = total_seconds % 60
payload = {
"mediaId": media_id,
"source": 0,
"videoTime": f"00:00:{annotation.time // 1000:02d}" if annotation.time else "00:00:00",
"videoTime": f"{hours:02d}:{minutes:02d}:{seconds:02d}",
"detections": [d.model_dump() for d in dtos],
}
if image_b64: