MCPcopy Create free account
hub / github.com/DeepLabCut/DeepLabCut / crop

Method crop

deeplabcut/utils/auxfun_videos.py:293–302  ·  view source on GitHub ↗
(self, suffix="crop", dest_folder=None)

Source from the content-addressed store, hash-verified

291 return clips
292
293 def crop(self, suffix="crop", dest_folder=None):
294 x1, _, y1, _ = self.get_bbox()
295 output_path = self.make_output_path(suffix, dest_folder)
296 command = (
297 f'ffmpeg -n -i "{self.video_path}" '
298 f"-filter:v crop={self.width}:{self.height}:{x1}:{y1} "
299 f'-c:a copy "{output_path}"'
300 )
301 subprocess.call(command, shell=True)
302 return output_path
303
304 def rotate(self, angle, rotatecw="Arbitrary", suffix="rotated", dest_folder=None):
305 output_path = self.make_output_path(suffix, dest_folder)

Callers 5

CropVideoFunction · 0.95
_crop_videoFunction · 0.95
extract_framesFunction · 0.45
test_writer_cropFunction · 0.45

Calls 3

make_output_pathMethod · 0.95
get_bboxMethod · 0.80
callMethod · 0.45

Tested by 1

test_writer_cropFunction · 0.36