Skip to content

Commit

Permalink
add some debug logging to frame cache
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeblackshear committed Jan 27, 2021
1 parent ce2a583 commit 0cf7827
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docker/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN apt-get -qq update \
python3-pip \
&& pip3 install -U /wheels/*.whl \
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn apt-key adv --fetch-keys https://packages.cloud.google.com/apt/doc/apt-key.gpg \
&& echo "deb https://packages.cloud.google.com/apt coral-edgetpu-unstable main" > /etc/apt/sources.list.d/coral-edgetpu.list \
&& echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \
&& echo "libedgetpu1-max libedgetpu/accepted-eula select true" | debconf-set-selections \
&& apt-get -qq update && apt-get -qq install --no-install-recommends -y \
libedgetpu1-max=15.0 \
Expand Down
2 changes: 2 additions & 0 deletions frigate/object_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def update(self, frame_time, current_detections):
if (not updated_obj.false_positive
and updated_obj.thumbnail_data['frame_time'] == frame_time
and frame_time not in self.frame_cache):
logging.info(f"Adding {frame_time} to cache.")
self.frame_cache[frame_time] = np.copy(current_frame)

# call event handlers
Expand Down Expand Up @@ -376,6 +377,7 @@ def update(self, frame_time, current_detections):
current_best_frames = set([obj.thumbnail_data['frame_time'] for obj in self.best_objects.values()])
thumb_frames_to_delete = [t for t in self.frame_cache.keys() if not t in current_thumb_frames and not t in current_best_frames]
for t in thumb_frames_to_delete:
logging.info(f"Removing {t} from cache.")
del self.frame_cache[t]

with self.current_frame_lock:
Expand Down

0 comments on commit 0cf7827

Please sign in to comment.