mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-26 13:47:03 +02:00
use a random string in the object id instead of the index
This commit is contained in:
parent
a8c0fadf95
commit
918386bdc1
@ -5,6 +5,8 @@ import cv2
|
|||||||
import itertools
|
import itertools
|
||||||
import copy
|
import copy
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import random
|
||||||
|
import string
|
||||||
import multiprocessing as mp
|
import multiprocessing as mp
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from scipy.spatial import distance as dist
|
from scipy.spatial import distance as dist
|
||||||
@ -17,7 +19,8 @@ class ObjectTracker():
|
|||||||
self.max_disappeared = max_disappeared
|
self.max_disappeared = max_disappeared
|
||||||
|
|
||||||
def register(self, index, obj):
|
def register(self, index, obj):
|
||||||
id = f"{obj['frame_time']}-{index}"
|
rand_id = ''.join(random.choices(string.ascii_lowercase + string.digits, k=6))
|
||||||
|
id = f"{obj['frame_time']}-{rand_id}"
|
||||||
obj['id'] = id
|
obj['id'] = id
|
||||||
obj['start_time'] = obj['frame_time']
|
obj['start_time'] = obj['frame_time']
|
||||||
obj['top_score'] = obj['score']
|
obj['top_score'] = obj['score']
|
||||||
|
Loading…
Reference in New Issue
Block a user