mirror of
https://github.com/azaion/detections.git
synced 2026-04-22 22:36:32 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user