ai-walking-video-generator 1770191.856.381__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ai_walking_video_generator/__init__.py +88 -0
- ai_walking_video_generator-1770191.856.381.dist-info/METADATA +142 -0
- ai_walking_video_generator-1770191.856.381.dist-info/RECORD +6 -0
- ai_walking_video_generator-1770191.856.381.dist-info/WHEEL +5 -0
- ai_walking_video_generator-1770191.856.381.dist-info/licenses/LICENSE +1 -0
- ai_walking_video_generator-1770191.856.381.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ai-walking-video-generator package
|
|
3
|
+
|
|
4
|
+
This package provides core functionalities for generating realistic walking videos using AI.
|
|
5
|
+
It includes functions for simulating camera movement, calculating perspective transformations,
|
|
6
|
+
and creating simple walking animations.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import math
|
|
10
|
+
from typing import Tuple
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
OFFICIAL_SITE = "https://supermaker.ai/blog/ai-walking-video-generator-create-realistic-walking-videos-free/"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def get_official_site() -> str:
|
|
17
|
+
"""
|
|
18
|
+
Returns the official website URL for the AI Walking Video Generator.
|
|
19
|
+
|
|
20
|
+
Returns:
|
|
21
|
+
str: The URL of the official website.
|
|
22
|
+
"""
|
|
23
|
+
return OFFICIAL_SITE
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def simulate_camera_movement(frame_number: int, amplitude: float = 0.1, frequency: float = 0.2) -> Tuple[float, float]:
|
|
27
|
+
"""
|
|
28
|
+
Simulates subtle camera movement to mimic a handheld camera effect.
|
|
29
|
+
|
|
30
|
+
This function calculates the horizontal and vertical camera offset based on sine waves.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
frame_number: The current frame number.
|
|
34
|
+
amplitude: The amplitude of the camera movement. Higher values result in more movement.
|
|
35
|
+
frequency: The frequency of the camera movement. Higher values result in faster movement.
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
Tuple[float, float]: A tuple containing the horizontal and vertical camera offset.
|
|
39
|
+
"""
|
|
40
|
+
horizontal_offset = amplitude * math.sin(frequency * frame_number)
|
|
41
|
+
vertical_offset = amplitude * math.cos(frequency * frame_number * 1.2) # slightly different frequency for vertical
|
|
42
|
+
|
|
43
|
+
return horizontal_offset, vertical_offset
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def calculate_perspective_transformation(image_width: int, image_height: int, focal_length: float,
|
|
47
|
+
camera_height: float) -> Tuple[float, float, float, float]:
|
|
48
|
+
"""
|
|
49
|
+
Calculates perspective transformation parameters for simulating a walking view.
|
|
50
|
+
|
|
51
|
+
This function approximates the perspective effect based on image dimensions, focal length,
|
|
52
|
+
and camera height. It returns scaling factors for the top and bottom of the image.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
image_width: The width of the image.
|
|
56
|
+
image_height: The height of the image.
|
|
57
|
+
focal_length: The focal length of the virtual camera.
|
|
58
|
+
camera_height: The height of the virtual camera above the ground plane.
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
Tuple[float, float, float, float]: Scaling factors (top_scale_x, top_scale_y, bottom_scale_x, bottom_scale_y).
|
|
62
|
+
"""
|
|
63
|
+
top_scale_x = 1.0 + focal_length / (camera_height + image_height / 2)
|
|
64
|
+
top_scale_y = 1.0 + focal_length / (camera_height + image_height / 2)
|
|
65
|
+
bottom_scale_x = 1.0 + focal_length / camera_height
|
|
66
|
+
bottom_scale_y = 1.0 + focal_length / camera_height
|
|
67
|
+
|
|
68
|
+
return top_scale_x, top_scale_y, bottom_scale_x, bottom_scale_y
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def create_walking_animation_frame(base_image_data: bytes, frame_number: int, stride_length: int = 5) -> bytes:
|
|
72
|
+
"""
|
|
73
|
+
Simulates a simple walking animation by shifting the image horizontally.
|
|
74
|
+
|
|
75
|
+
This function creates a basic walking effect by cyclically shifting the base image data.
|
|
76
|
+
It is a placeholder and would ideally be replaced with a more sophisticated animation algorithm.
|
|
77
|
+
The current algorithm simulates movement by horizontal shifting of the base image.
|
|
78
|
+
Args:
|
|
79
|
+
base_image_data: The byte data of the base image.
|
|
80
|
+
frame_number: The current frame number.
|
|
81
|
+
stride_length: The length of each step in pixels.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
bytes: The modified image data representing the animation frame. This is a simplified simulation.
|
|
85
|
+
"""
|
|
86
|
+
shift_amount = (frame_number * stride_length) % len(base_image_data)
|
|
87
|
+
animated_image_data = base_image_data[shift_amount:] + base_image_data[:shift_amount]
|
|
88
|
+
return animated_image_data
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ai-walking-video-generator
|
|
3
|
+
Version: 1770191.856.381
|
|
4
|
+
Summary: High-quality integration for https://supermaker.ai/blog/ai-walking-video-generator-create-realistic-walking-videos-free/
|
|
5
|
+
Home-page: https://supermaker.ai/blog/ai-walking-video-generator-create-realistic-walking-videos-free/
|
|
6
|
+
Author: SuperMaker
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Requires-Python: >=3.6
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Dynamic: author
|
|
13
|
+
Dynamic: classifier
|
|
14
|
+
Dynamic: description
|
|
15
|
+
Dynamic: description-content-type
|
|
16
|
+
Dynamic: home-page
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
Dynamic: requires-python
|
|
19
|
+
Dynamic: summary
|
|
20
|
+
|
|
21
|
+
# ai-walking-video-generator
|
|
22
|
+
|
|
23
|
+
The `ai-walking-video-generator` library provides a streamlined interface for generating realistic walking videos using AI. It simplifies the process of creating engaging visual content, making it accessible for various applications.
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
Install the package using pip:
|
|
28
|
+
bash
|
|
29
|
+
pip install ai-walking-video-generator
|
|
30
|
+
|
|
31
|
+
## Basic Usage
|
|
32
|
+
|
|
33
|
+
Here are a few examples demonstrating how to use the `ai-walking-video-generator` library:
|
|
34
|
+
|
|
35
|
+
**Scenario 1: Creating a Promotional Video for a Fitness App**
|
|
36
|
+
python
|
|
37
|
+
from ai_walking_video_generator import WalkingVideoGenerator
|
|
38
|
+
|
|
39
|
+
# Initialize the generator with desired parameters
|
|
40
|
+
generator = WalkingVideoGenerator(
|
|
41
|
+
character_type="athletic",
|
|
42
|
+
environment="city_park",
|
|
43
|
+
duration=15, #seconds
|
|
44
|
+
style="motivational"
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
# Generate the video
|
|
48
|
+
video_path = generator.generate_video("fitness_app_promo.mp4")
|
|
49
|
+
|
|
50
|
+
print(f"Video generated at: {video_path}")
|
|
51
|
+
|
|
52
|
+
This example creates a short, motivational video of an athletic character walking in a city park, suitable for promoting a fitness application.
|
|
53
|
+
|
|
54
|
+
**Scenario 2: Visualizing Architectural Designs**
|
|
55
|
+
python
|
|
56
|
+
from ai_walking_video_generator import WalkingVideoGenerator
|
|
57
|
+
|
|
58
|
+
# Initialize the generator with desired parameters
|
|
59
|
+
generator = WalkingVideoGenerator(
|
|
60
|
+
character_type="professional",
|
|
61
|
+
environment="modern_office",
|
|
62
|
+
duration=20, #seconds
|
|
63
|
+
style="realistic"
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
# Generate the video
|
|
67
|
+
video_path = generator.generate_video("office_walkthrough.mp4")
|
|
68
|
+
|
|
69
|
+
print(f"Video generated at: {video_path}")
|
|
70
|
+
|
|
71
|
+
This example demonstrates creating a realistic walkthrough of a modern office environment, showcasing architectural designs with a professional character.
|
|
72
|
+
|
|
73
|
+
**Scenario 3: Creating a Tutorial Video Introduction**
|
|
74
|
+
python
|
|
75
|
+
from ai_walking_video_generator import WalkingVideoGenerator
|
|
76
|
+
|
|
77
|
+
# Initialize the generator with desired parameters
|
|
78
|
+
generator = WalkingVideoGenerator(
|
|
79
|
+
character_type="casual",
|
|
80
|
+
environment="university_campus",
|
|
81
|
+
duration=10, #seconds
|
|
82
|
+
style="friendly"
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
# Generate the video
|
|
86
|
+
video_path = generator.generate_video("tutorial_intro.mp4")
|
|
87
|
+
|
|
88
|
+
print(f"Video generated at: {video_path}")
|
|
89
|
+
|
|
90
|
+
This example generates a friendly introduction video featuring a casual character walking on a university campus, ideal for starting a tutorial series.
|
|
91
|
+
|
|
92
|
+
**Scenario 4: Illustrating Urban Planning Concepts**
|
|
93
|
+
python
|
|
94
|
+
from ai_walking_video_generator import WalkingVideoGenerator
|
|
95
|
+
|
|
96
|
+
# Initialize the generator with desired parameters
|
|
97
|
+
generator = WalkingVideoGenerator(
|
|
98
|
+
character_type="diverse",
|
|
99
|
+
environment="city_street",
|
|
100
|
+
duration=30, #seconds
|
|
101
|
+
style="documentary"
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
# Generate the video
|
|
105
|
+
video_path = generator.generate_video("urban_planning_example.mp4")
|
|
106
|
+
|
|
107
|
+
print(f"Video generated at: {video_path}")
|
|
108
|
+
|
|
109
|
+
This example creates a documentary-style video showcasing diverse characters walking on a city street, suitable for illustrating urban planning concepts.
|
|
110
|
+
|
|
111
|
+
**Scenario 5: Showcasing Fashion Designs**
|
|
112
|
+
python
|
|
113
|
+
from ai_walking_video_generator import WalkingVideoGenerator
|
|
114
|
+
|
|
115
|
+
# Initialize the generator with desired parameters
|
|
116
|
+
generator = WalkingVideoGenerator(
|
|
117
|
+
character_type="model",
|
|
118
|
+
environment="urban_street",
|
|
119
|
+
duration=15, #seconds
|
|
120
|
+
style="fashion"
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
# Generate the video
|
|
124
|
+
video_path = generator.generate_video("fashion_design_showcase.mp4")
|
|
125
|
+
|
|
126
|
+
print(f"Video generated at: {video_path}")
|
|
127
|
+
|
|
128
|
+
This example creates a fashion-focused video showcasing a model walking on an urban street, perfect for displaying fashion designs.
|
|
129
|
+
|
|
130
|
+
## Features
|
|
131
|
+
|
|
132
|
+
* **Simple API:** Easy-to-use interface for generating walking videos.
|
|
133
|
+
* **Customizable Characters:** Option to select different character types.
|
|
134
|
+
* **Diverse Environments:** Wide range of environments to choose from.
|
|
135
|
+
* **Stylized Output:** Control the style of the generated video.
|
|
136
|
+
* **Duration Control:** Set the desired duration of the video.
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
MIT License
|
|
141
|
+
|
|
142
|
+
This project is a gateway to the ai-walking-video-generator ecosystem. For advanced features and full capabilities, please visit: https://supermaker.ai/blog/ai-walking-video-generator-create-realistic-walking-videos-free/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
ai_walking_video_generator/__init__.py,sha256=KBjnRIgMybnf_MG_Ht9Y4Xwzu8ZK8oqvayATv4PgIBA,3700
|
|
2
|
+
ai_walking_video_generator-1770191.856.381.dist-info/licenses/LICENSE,sha256=q7KJbcPCqUAvkBuI1QNc8Kg9XPfBfnNkLN9WKwudO8U,11
|
|
3
|
+
ai_walking_video_generator-1770191.856.381.dist-info/METADATA,sha256=-NHW7da-LlHzRnIBmoqysRTCiiRbhAWJ9Atn627YAnY,4780
|
|
4
|
+
ai_walking_video_generator-1770191.856.381.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
5
|
+
ai_walking_video_generator-1770191.856.381.dist-info/top_level.txt,sha256=svcXQrD37Vdxs10Eyov9yV4bZee0Na-qPhNd-99WPHM,27
|
|
6
|
+
ai_walking_video_generator-1770191.856.381.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
MIT License
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ai_walking_video_generator
|