Skip to content

Commit

Permalink
roi frames are now cached in $HOME/.WAZP/roi_frames
Browse files Browse the repository at this point in the history
  • Loading branch information
niksirbi committed Feb 16, 2023
1 parent 41d2b21 commit e136772
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ include README.md
include *.py
recursive-include wazp *.py
recursive-include sample_project *.avi
recursive-include sample_project *.png
recursive-include sample_project_2 *.avi
recursive-include sample_project_2 *.h5

Expand Down
Binary file not shown.
Binary file not shown.
8 changes: 5 additions & 3 deletions wazp/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,8 @@ def update_frame_graph(
video_path = pl.Path(video_path)
video_name = video_path.name

# Get directory and path for roi frame
frames_dir = video_path.parent / "roi_frames"
# Cache frames in a .WAZP folder in the home directory
frames_dir = pl.Path.home() / ".WAZP" / "roi_frames"
frames_dir.mkdir(parents=True, exist_ok=True)
frame_path = frames_dir / f"{video_path.stem}_frame-{frame_idx}.png"

Expand Down Expand Up @@ -621,7 +621,9 @@ def update_frame_graph(
)

if frame_path.exists():
alert_msg = f"Found cached frame {frame_idx} from {video_name}"
alert_msg = (
f"Showing cached frame {frame_idx} from {video_name}"
)
alert_color = "success"
alert_is_open = True
else:
Expand Down

0 comments on commit e136772

Please sign in to comment.