Skip to content

Commit

Permalink
ran black
Browse files Browse the repository at this point in the history
  • Loading branch information
gferraro committed May 13, 2024
1 parent b3e1595 commit 713163a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/piclassifier/cptvmotiondetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def skip_frame(self):
def is_affected_by_ffc(cptv_frame):
if cptv_frame.time_on is None or cptv_frame.last_ffc_time is None:
return False
if isinstance(cptv_frame.time_on,int):
if isinstance(cptv_frame.time_on, int):
return (
cptv_frame.time_on - cptv_frame.last_ffc_time
) < CPTVMotionDetector.FFC_PERIOD.seconds
Expand Down
9 changes: 4 additions & 5 deletions src/track/clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ def calculate_background(self, frame_reader):
self.update_background(frame.pix)
self._background_calculated()
return



first_frame = frame
initial_frames = None
initial_diff = None
Expand Down Expand Up @@ -251,7 +250,7 @@ def remove_background_animals(self, initial_frame, initial_diff):

max_region = Rectangle(0, 0, self.res_x, self.res_y)
for component, centroid in zip(lower_objects[1:], centroids[1:]):
print("Found component",component)
print("Found component", component)
region = Region(
component[0],
component[1],
Expand All @@ -267,11 +266,11 @@ def remove_background_animals(self, initial_frame, initial_diff):
component[4],
)
continue
print("Region is",region)
print("Region is", region)
background_region = region.subimage(initial_frame)
norm_back = background_region.copy()
norm_back, _ = normalize(norm_back, new_max=255)
print(norm_back.dtype,norm_back.max())
print(norm_back.dtype, norm_back.max())
sub_components, sub_connected, sub_stats, centroids = detect_objects(
np.uint8(norm_back), otsus=True
)
Expand Down
4 changes: 2 additions & 2 deletions src/track/cliptrackextractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def parse_clip(self, clip, process_background=False):
camera_model = None
if header.model:
camera_model = header.model
print("Camera",camera_model)
print("Camera", camera_model)
clip.set_model(camera_model)

# if we have the triggered motion threshold should use that
Expand All @@ -116,7 +116,7 @@ def parse_clip(self, clip, process_background=False):
temp_thresh = motion.get("triggeredthresh")
if temp_thresh:
clip.temp_thresh = temp_thresh
video_start_time = datetime.fromtimestamp(header.timestamp/1000000)
video_start_time = datetime.fromtimestamp(header.timestamp / 1000000)
video_start_time = video_start_time.astimezone(Clip.local_tz)
clip.set_video_stats(video_start_time)
clip.calculate_background(reader)
Expand Down

0 comments on commit 713163a

Please sign in to comment.