Spaces:
Runtime error
Runtime error
Update requirements.txt
Browse files- requirements.txt +20 -1
requirements.txt
CHANGED
@@ -3,4 +3,23 @@ transformers
|
|
3 |
gradio
|
4 |
huggingface_hub
|
5 |
numpy
|
6 |
-
opencv-python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
gradio
|
4 |
huggingface_hub
|
5 |
numpy
|
6 |
+
opencv-python
|
7 |
+
# Capa de Transformada de Fourier
|
8 |
+
class FourierTransformLayer(Layer):
|
9 |
+
def call(self, inputs):
|
10 |
+
fourier = tf.signal.fft2d(tf.cast(inputs, tf.complex64))
|
11 |
+
fourier = tf.abs(fourier)
|
12 |
+
return tf.concat([tf.math.real(fourier), tf.math.imag(fourier)], axis=-1)
|
13 |
+
|
14 |
+
def compute_output_shape(self, input_shape):
|
15 |
+
return (input_shape[0], input_shape[1], input_shape[2], input_shape[3] * 2)
|
16 |
+
|
17 |
+
# Capa de Transformada Inversa de Fourier
|
18 |
+
class InverseFourierTransformLayer(Layer):
|
19 |
+
def call(self, inputs):
|
20 |
+
real_part, imag_part = tf.split(inputs, num_or_size_splits=2, axis=-1)
|
21 |
+
complex_fourier = tf.complex(real_part, imag_part)
|
22 |
+
return tf.abs(tf.signal.ifft2d(complex_fourier))
|
23 |
+
|
24 |
+
def compute_output_shape(self, input_shape):
|
25 |
+
return (input_shape[0], input_shape[1], input_shape[2], input_shape[3] // 2)
|