DynamicCropper is a Python library that allows you to dynamically crop a person in a video based on various parameters.
This section outlines the tasks and improvements planned for the DynamicCropper project.
- Improve performance for large video files.
- Add threading to operations.
- Create verbose control.
- Better outputs and error prints.
- Logger.
- Better file structure.
- Add better
requirements.txt
Clone the repository to your local machine using the following command:
git clone https://github.com/AteltaAI/DynamicCropper.git
Inside the repository folder, create a new Python test file (e.g., test_cropper.py
). You can use the following example code in your test file:
from dynamic_cropper import DynamicCropper
cropper = DynamicCropper(
frame_interval=10,
size_aware=True,
only_object=True
)
# 'input_path' can be a youtube link or local video file path.
result = cropper.crop(
input_path="https://youtu.be/GcZJMiHds3U",
output_folder_path="output_folder"
)
Run the test file to see how DynamicCropper works.
python test_cropper.py
input-video.2.mp4
from dynamic_cropper import DynamicCropper
cropper = DynamicCropper(
frame_interval=10,
size_aware=False,
only_object=False
)
result = cropper.crop(
input_path=rf"input-video (2).mp4",
output_folder_path="output_folder"
)
print(result)
output_audio_false_false.mp4
from dynamic_cropper import DynamicCropper
cropper = DynamicCropper(
frame_interval=10,
size_aware=True,
only_object=True
)
result = cropper.crop(
input_path=rf"input-video (2).mp4",
output_folder_path="output_folder"
)
print(result)
output_audio_true_true.mp4
from dynamic_cropper import DynamicCropper
cropper = DynamicCropper(
frame_interval=10,
size_aware=True,
only_object=False
)
result = cropper.crop(
input_path=rf"input-video (2).mp4",
output_folder_path="output_folder"
)
print(result)