Visitar URL original
Refactor VideoProcessor class by C-Achard · Pull Request #3358 · DeepLabCut/DeepLabCut · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3e47c96
Sort and stringify video list
C-Achard Jun 5, 2026
108beba
Convert video paths to strings for vp calls
C-Achard Jun 5, 2026
257a8c9
Revert "Sort and stringify video list"
C-Achard Jun 9, 2026
902aa1d
Add tests for VideoProcessorCV
C-Achard Jun 9, 2026
d3ed1b4
Turn VideoProcessor into ABC with abstract methods
C-Achard Jun 9, 2026
bffcb92
Use clip properties for height/width/fps
C-Achard Jun 9, 2026
f338f3c
Add properties and docs to video processor
C-Achard Jun 9, 2026
f18d166
Avoid str() casts when calling vp
C-Achard Jun 9, 2026
31f8985
Initialize video attrs and switch to logging
C-Achard Jun 9, 2026
203b131
Change logging to exception
C-Achard Jun 9, 2026
ef1d2e2
Test VideoProcessorCV accepts Path and stores str
C-Achard Jun 9, 2026
f0d4fd4
Add type annotations to VideoProcessor.__init__
C-Achard Jun 9, 2026
17de1f4
Address review comments
C-Achard Jun 10, 2026
09dd8b4
Refactor VideoProcessor API to video_fps/h/w
C-Achard Jun 10, 2026
5e24647
Mark legacy VideoProcessor accessors as deprecated
C-Achard Jun 10, 2026
84c60a2
Disable deprecated decorator on FPS property
C-Achard Jun 10, 2026
df89520
Comment on deprecations
C-Achard Jun 10, 2026
fbb6352
Fix incorrect property usage
C-Achard Jun 10, 2026
f07ba9e
Rename VideoProcessor.video_fps to fps
C-Achard Jun 11, 2026
06a7521
Rename VideoProcessor h/w to height/width
C-Achard Jun 12, 2026
8e86e02
Fix missing renaming of properties in make_labeled_video
C-Achard Jun 15, 2026
1496ff2
Merge branch 'main' into cy/fix-video-reader-set-error
MMathisLab Jun 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deeplabcut/gui/tabs/create_videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def update_draw_skeleton_choice(self, rb):
def create_videos(self):
config = self.root.config
shuffle = self.root.shuffle_value
videos = self.files
videos = sorted(str(v) for v in self.files)
trailpoints = self.trail_points.value()
if hasattr(self, "color_by_widget"):
# Multianimal scenario.
Expand Down
8 changes: 4 additions & 4 deletions deeplabcut/utils/make_labeled_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ def proc_video(
if bodyparts2connect:
all_bpts = df.columns.get_level_values("bodyparts")[::3]
inds = get_segment_indices(bodyparts2connect, all_bpts)
clip = vp(fname=video, fps=outputframerate)
clip = vp(fname=str(video), fps=outputframerate)
create_video_with_keypoints_only(
Comment thread
C-Achard marked this conversation as resolved.
Resolved
df,
videooutname,
Expand All @@ -926,7 +926,7 @@ def proc_video(
tmpfolder = os.path.join(str(videofolder), "temp-" + vname)
if save_frames:
auxiliaryfunctions.attempt_to_make_folder(tmpfolder)
clip = vp(video)
clip = vp(str(video))
CreateVideoSlow(
videooutname,
clip,
Expand Down Expand Up @@ -1018,7 +1018,7 @@ def create_video(
output_path = h5file.replace(".h5", f"{s}_labeled.mp4")

clip = vp(
fname=video,
fname=str(video),
sname=str(output_path),
codec=codec,
sw=bbox[1] - bbox[0] if display_cropped else "",
Expand Down Expand Up @@ -1286,7 +1286,7 @@ def create_video_with_all_detections(

pcutoff = cfg["pcutoff"]
dotsize = cfg["dotsize"]
clip = vp(fname=video, sname=outputname, codec="mp4v")
clip = vp(fname=str(video), sname=str(outputname), codec="mp4v")
ny, nx = clip.height(), clip.width()

bboxes_pcutoff = (
Expand Down
Loading