Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -43,8 +43,9 @@ def fourier_transform_drawing(input_image, frames, coefficients):
|
|
43 |
scale_factor_y = desired_range / y_range
|
44 |
|
45 |
# apply scaling
|
|
|
46 |
xs = (xs - np.mean(xs)) * scale_factor_x
|
47 |
-
ys = (ys
|
48 |
|
49 |
t_list = np.linspace(0, tau, len(xs))
|
50 |
|
@@ -112,8 +113,8 @@ interface = gr.Interface(
|
|
112 |
fn=fourier_transform_drawing,
|
113 |
inputs=[
|
114 |
gr.Image(label="Input Image", sources=['upload'], type="pil"),
|
115 |
-
gr.Slider(minimum=
|
116 |
-
gr.Slider(minimum=
|
117 |
],
|
118 |
outputs=gr.Video(),
|
119 |
title="Fourier Transform Drawing",
|
|
|
43 |
scale_factor_y = desired_range / y_range
|
44 |
|
45 |
# apply scaling
|
46 |
+
# ys needs to be flipped vertically
|
47 |
xs = (xs - np.mean(xs)) * scale_factor_x
|
48 |
+
ys = (-ys + np.mean(ys)) * scale_factor_y
|
49 |
|
50 |
t_list = np.linspace(0, tau, len(xs))
|
51 |
|
|
|
113 |
fn=fourier_transform_drawing,
|
114 |
inputs=[
|
115 |
gr.Image(label="Input Image", sources=['upload'], type="pil"),
|
116 |
+
gr.Slider(minimum=5, maximum=500, value=50, label="Number of Frames"),
|
117 |
+
gr.Slider(minimum=1, maximum=500, value=50, label="Number of Coefficients")
|
118 |
],
|
119 |
outputs=gr.Video(),
|
120 |
title="Fourier Transform Drawing",
|