Skip to content

Commit

Permalink
Merge pi classifier (#214)
Browse files Browse the repository at this point in the history
* sub preview frames from start rec datetime

* up version

---------

Co-authored-by: gferraro <[email protected]>
  • Loading branch information
gferraro and gferraro authored Nov 13, 2024
1 parent 5884964 commit d299543
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "hatchling.build"

[project]
name = "classifier_pipeline"
version = "0.0.17"
version = "0.0.18"
authors = [
{ name="Giampaolo Ferraro", email="[email protected]" },
]
Expand Down
11 changes: 6 additions & 5 deletions src/piclassifier/piclassifier.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime
from datetime import datetime, timedelta
import json
import logging
import os
Expand All @@ -8,7 +8,6 @@
import logging
from track.clip import Clip


from .motiondetector import SlidingWindow
from .processor import Processor

Expand Down Expand Up @@ -290,8 +289,11 @@ def new_clip(self, preview_frames):
)
global clip
clip = self.clip
self.clip.video_start_time = datetime.now()
self.clip.num_preview_frames = self.preview_frames
self.clip.video_start_time = datetime.now() - timedelta(
seconds=len(preview_frames) / self.headers.fps
)

self.clip.num_preview_frames = len(preview_frames)

self.clip.set_res(self.res_x, self.res_y)
self.clip.set_frame_buffer(
Expand All @@ -303,7 +305,6 @@ def new_clip(self, preview_frames):
),
max_frames=self.max_keep_frames,
)
edge_pixels = self.tracking_config.edge_pixels

self.clip.update_background(self.motion_detector.background.copy())
self.clip._background_calculated()
Expand Down

0 comments on commit d299543

Please sign in to comment.