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

Method rotate

deeplabcut/utils/auxfun_videos.py:304–317  ·  view source on GitHub ↗
(self, angle, rotatecw="Arbitrary", suffix="rotated", dest_folder=None)

Source from the content-addressed store, hash-verified

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)
306 command = f'ffmpeg -n -i "{self.video_path}" -vf '
307 if rotatecw == "Arbitrary":
308 angle = np.deg2rad(angle)
309 command += f"rotate={angle} "
310 elif rotatecw == "Yes":
311 command += "transpose=1 "
312 else:
313 raise ValueError("Unknown rotation direction.")
314
315 command += f'-c:a copy "{output_path}"'
316 subprocess.call(command, shell=True)
317 return output_path
318
319 def rescale(
320 self,

Callers 2

rotate_videoFunction · 0.95
drawMethod · 0.80

Calls 2

make_output_pathMethod · 0.95
callMethod · 0.45

Tested by

no test coverage detected