Spaces:
Running
Running
Daniel Gil-U Fuhge
commited on
Commit
•
5340dd0
1
Parent(s):
6295f27
Bugfix coordinates
Browse files
src/postprocessing/postprocessing.py
CHANGED
@@ -95,13 +95,13 @@ def animate_logo(model_output: pd.DataFrame, logo_path: str):
|
|
95 |
# Check type and call method
|
96 |
if animation_type == 1:
|
97 |
# animation: translate
|
98 |
-
from_x = animations_by_type[animation_type][i][12]
|
99 |
-
from_y = animations_by_type[animation_type][i][13]
|
100 |
# Check if there is a next translate animation
|
101 |
if i < len(animations_by_type[animation_type]) - 1:
|
102 |
# animation endpoint is next translate animation's starting point
|
103 |
-
to_x = animations_by_type[animation_type][i+1][12]
|
104 |
-
to_y = animations_by_type[animation_type][i+1][13]
|
105 |
else:
|
106 |
# animation endpoint is final position of object
|
107 |
to_x = 0
|
@@ -127,10 +127,10 @@ def animate_logo(model_output: pd.DataFrame, logo_path: str):
|
|
127 |
current_animations.append(_animation_translate(animation_id, begin, dur, from_x, from_y, to_x, to_y))
|
128 |
elif animation_type == 2:
|
129 |
print('curve')
|
130 |
-
from_x = animations_by_type[animation_type][i][12]
|
131 |
-
from_y = animations_by_type[animation_type][i][13]
|
132 |
-
via_x = animations_by_type[animation_type][i][14]
|
133 |
-
via_y = animations_by_type[animation_type][i][15]
|
134 |
# Check if there is a next curve animation
|
135 |
if i < len(animations_by_type[animation_type]) - 1:
|
136 |
# animation endpoint is next curve animation's starting point
|
@@ -199,11 +199,11 @@ def animate_logo(model_output: pd.DataFrame, logo_path: str):
|
|
199 |
current_animations.append(_animation_rotate(animation_id, begin, dur, from_degree, to_degree, midpoints))
|
200 |
elif animation_type == 5:
|
201 |
# animation: skewX
|
202 |
-
from_x = animations_by_type[animation_type][i][18]
|
203 |
# Check if there is a next skewX animation
|
204 |
if i < len(animations_by_type[animation_type]) - 1:
|
205 |
# animation endpoint is next skewX animation's starting point
|
206 |
-
to_x = animations_by_type[animation_type][i+1][18]
|
207 |
else:
|
208 |
# animation endpoint is final position of object
|
209 |
to_x = 1
|
@@ -219,11 +219,11 @@ def animate_logo(model_output: pd.DataFrame, logo_path: str):
|
|
219 |
current_animations.append(_animation_skewX(animation_id, begin, dur, from_x, to_x))
|
220 |
elif animation_type == 6:
|
221 |
# animation: skewY
|
222 |
-
from_y = animations_by_type[animation_type][i][19]
|
223 |
# Check if there is a next skewY animation
|
224 |
if i < len(animations_by_type[animation_type]) - 1:
|
225 |
# animation endpoint is next skewY animation's starting point
|
226 |
-
to_y = animations_by_type[animation_type][i+1][19]
|
227 |
else:
|
228 |
# animation endpoint is final position of object
|
229 |
to_y = 1
|
|
|
95 |
# Check type and call method
|
96 |
if animation_type == 1:
|
97 |
# animation: translate
|
98 |
+
from_x = int(animations_by_type[animation_type][i][12])
|
99 |
+
from_y = int(animations_by_type[animation_type][i][13])
|
100 |
# Check if there is a next translate animation
|
101 |
if i < len(animations_by_type[animation_type]) - 1:
|
102 |
# animation endpoint is next translate animation's starting point
|
103 |
+
to_x = int(animations_by_type[animation_type][i+1][12])
|
104 |
+
to_y = int(animations_by_type[animation_type][i+1][13])
|
105 |
else:
|
106 |
# animation endpoint is final position of object
|
107 |
to_x = 0
|
|
|
127 |
current_animations.append(_animation_translate(animation_id, begin, dur, from_x, from_y, to_x, to_y))
|
128 |
elif animation_type == 2:
|
129 |
print('curve')
|
130 |
+
from_x = int(animations_by_type[animation_type][i][12])
|
131 |
+
from_y = int(animations_by_type[animation_type][i][13])
|
132 |
+
via_x = int(animations_by_type[animation_type][i][14])
|
133 |
+
via_y = int(animations_by_type[animation_type][i][15])
|
134 |
# Check if there is a next curve animation
|
135 |
if i < len(animations_by_type[animation_type]) - 1:
|
136 |
# animation endpoint is next curve animation's starting point
|
|
|
199 |
current_animations.append(_animation_rotate(animation_id, begin, dur, from_degree, to_degree, midpoints))
|
200 |
elif animation_type == 5:
|
201 |
# animation: skewX
|
202 |
+
from_x = int(animations_by_type[animation_type][i][18])
|
203 |
# Check if there is a next skewX animation
|
204 |
if i < len(animations_by_type[animation_type]) - 1:
|
205 |
# animation endpoint is next skewX animation's starting point
|
206 |
+
to_x = int(animations_by_type[animation_type][i+1][18])
|
207 |
else:
|
208 |
# animation endpoint is final position of object
|
209 |
to_x = 1
|
|
|
219 |
current_animations.append(_animation_skewX(animation_id, begin, dur, from_x, to_x))
|
220 |
elif animation_type == 6:
|
221 |
# animation: skewY
|
222 |
+
from_y = int(animations_by_type[animation_type][i][19])
|
223 |
# Check if there is a next skewY animation
|
224 |
if i < len(animations_by_type[animation_type]) - 1:
|
225 |
# animation endpoint is next skewY animation's starting point
|
226 |
+
to_y = int(animations_by_type[animation_type][i+1][19])
|
227 |
else:
|
228 |
# animation endpoint is final position of object
|
229 |
to_y = 1
|