You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dlclive/benchmark.py
+37-16Lines changed: 37 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -113,15 +113,19 @@ def benchmark_videos(
113
113
resize : int, optional
114
114
resize factor. Can only use one of resize or pixels. If both are provided, will use pixels. by default None
115
115
pixels : int, optional
116
-
downsize image to this number of pixels, maintaining aspect ratio. Can only use one of resize or pixels. If both are provided, will use pixels. by default None
116
+
downsize image to this number of pixels, maintaining aspect ratio. Can only use one of resize or pixels.
117
+
If both are provided, will use pixels. by default None
117
118
cropping : list of int
118
119
cropping parameters in pixel number: [x1, x2, y1, y2]
Analyze a video (save poses to hdf5) and create a labeled video, similar to :function:`DeepLabCut.benchmark_videos` and :function:`create_labeled_video`
164
+
Analyze a video (save poses to hdf5) and create a labeled video,
165
+
similar to :function:`DeepLabCut.benchmark_videos` and :function:`create_labeled_video`
Parameters for dynamic cropping. If the state is true, then dynamic cropping will be performed. That means that if an object is detected (i.e. any body part > detectiontreshold), then object boundaries are computed according to the smallest/largest x position and smallest/largest y position of all body parts. This window is expanded by the margin and from then on only the posture within this crop is analyzed (until the object is lost, i.e. <detection treshold). The current position is utilized for updating the crop window for the next frame (this is why the margin is important and should be set large enough given the movement of the animal).
413
+
Parameters for dynamic cropping.
414
+
If the state is true, then dynamic cropping will be performed.
415
+
That means that if an object is detected (i.e. any body part > detectiontreshold),
416
+
then object boundaries are computed according to the smallest/largest x position and smallest/largest y
417
+
position of all body parts. This window is expanded by the margin and from then on only the posture within
418
+
this crop is analyzed (until the object is lost, i.e. <detection treshold).
419
+
The current position is utilized for updating the crop window for the next frame
420
+
(this is why the margin is important and should be set large enough given the movement of the animal).
401
421
n_frames : int, optional
402
422
Number of frames to run inference on, by default 1000
403
423
print_rate: bool, optional, default=False
@@ -498,7 +518,8 @@ def benchmark(
498
518
ret, frame=cap.read()
499
519
ifnotret:
500
520
warnings.warn(
501
-
f"Did not complete {n_frames:d} frames. There probably were not enough frames in the video {video_path}.",
521
+
f"Did not complete {n_frames:d} frames."
522
+
" There probably were not enough frames in the video {video_path}.",
Parameters for dynamic cropping. If the state is true, then dynamic cropping will be performed. That means that if an object is detected (i.e. any body part > detectiontreshold), then object boundaries are computed according to the smallest/largest x position and smallest/largest y position of all body parts. This window is expanded by the margin and from then on only the posture within this crop is analyzed (until the object is lost, i.e. <detection treshold). The current position is utilized for updating the crop window for the next frame (this is why the margin is important and should be set large enough given the movement of the animal).
138
+
Parameters for dynamic cropping.
139
+
If the state is true, then dynamic cropping will be performed.
140
+
That means that if an object is detected (i.e. any body part > detectiontreshold),
141
+
then object boundaries are computed according to the
142
+
smallest/largest x position and smallest/largest y position of all body parts.
143
+
This window is expanded by the margin and from then on only the posture within
144
+
this crop is analyzed (until the object is lost, i.e. <detection treshold).
145
+
The current position is utilized for updating the crop window for the next frame
146
+
(this is why the margin is important and should be set large enough given the movement of the animal).
136
147
save_poses : bool, optional, default=False
137
148
Whether to save the detected poses to CSV and HDF5 files.
0 commit comments