mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-19 19:06:16 +01: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 copy
|
||||
import numpy as np
|
||||
import random
|
||||
import string
|
||||
import multiprocessing as mp
|
||||
from collections import defaultdict
|
||||
from scipy.spatial import distance as dist
|
||||
@ -17,7 +19,8 @@ class ObjectTracker():
|
||||
self.max_disappeared = max_disappeared
|
||||
|
||||
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['start_time'] = obj['frame_time']
|
||||
obj['top_score'] = obj['score']
|
||||
|
Loading…
Reference in New Issue
Block a user