mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-01 16:55:21 +03:00
Fix 'FileExistsError' shared memory exception
This commit is contained in:
parent
d2bc2c20c1
commit
5312df0f34
@ -146,10 +146,16 @@ class FrigateApp():
|
|||||||
model_shape = (self.config.model.height, self.config.model.width)
|
model_shape = (self.config.model.height, self.config.model.width)
|
||||||
for name in self.config.cameras.keys():
|
for name in self.config.cameras.keys():
|
||||||
self.detection_out_events[name] = mp.Event()
|
self.detection_out_events[name] = mp.Event()
|
||||||
shm_in = mp.shared_memory.SharedMemory(name=name, create=True, size=self.config.model.height*self.config.model.width*3)
|
|
||||||
shm_out = mp.shared_memory.SharedMemory(name=f"out-{name}", create=True, size=20*6*4)
|
try:
|
||||||
self.detection_shms.append(shm_in)
|
self.detection_shms.append(mp.shared_memory.SharedMemory(name=name, create=True, size=self.config.model.height*self.config.model.width*3))
|
||||||
self.detection_shms.append(shm_out)
|
except FileExistsError:
|
||||||
|
self.detection_shms.append(mp.shared_memory.SharedMemory(name=name))
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.detection_shms.append(mp.shared_memory.SharedMemory(name=f"out-{name}", create=True, size=20*6*4))
|
||||||
|
except FileExistsError:
|
||||||
|
self.detection_shms.append(mp.shared_memory.SharedMemory(name=f"out-{name}"))
|
||||||
|
|
||||||
for name, detector in self.config.detectors.items():
|
for name, detector in self.config.detectors.items():
|
||||||
if detector.type == 'cpu':
|
if detector.type == 'cpu':
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user