Spaces:
Runtime error
Runtime error
Andrei Cozma
commited on
Commit
·
2969e10
1
Parent(s):
0ee379e
Updates
Browse files
app.py
CHANGED
|
@@ -148,7 +148,7 @@ def get_ifft_image(fft):
|
|
| 148 |
|
| 149 |
def fft_mag_image(fft):
|
| 150 |
print("-" * 80)
|
| 151 |
-
print("fft_mag_image: ")
|
| 152 |
|
| 153 |
fft_mag = np.abs(fft)
|
| 154 |
fft_mag = np.log(fft_mag + 1)
|
|
@@ -163,7 +163,7 @@ def fft_mag_image(fft):
|
|
| 163 |
|
| 164 |
def fft_phase_image(fft):
|
| 165 |
print("-" * 80)
|
| 166 |
-
print("fft_phase_image: ")
|
| 167 |
|
| 168 |
fft_phase = np.angle(fft)
|
| 169 |
fft_phase = fft_phase + np.pi
|
|
@@ -171,7 +171,7 @@ def fft_phase_image(fft):
|
|
| 171 |
|
| 172 |
# scale 0 to 1
|
| 173 |
fft_phase = (fft_phase - np.min(fft_phase)) / (
|
| 174 |
-
np.max(fft_phase) - np.min(fft_phase)
|
| 175 |
)
|
| 176 |
# scale to (0, 255)
|
| 177 |
fft_phase = fft_phase * 255
|
|
|
|
| 148 |
|
| 149 |
def fft_mag_image(fft):
|
| 150 |
print("-" * 80)
|
| 151 |
+
print(f"fft_mag_image: {fft.shape}")
|
| 152 |
|
| 153 |
fft_mag = np.abs(fft)
|
| 154 |
fft_mag = np.log(fft_mag + 1)
|
|
|
|
| 163 |
|
| 164 |
def fft_phase_image(fft):
|
| 165 |
print("-" * 80)
|
| 166 |
+
print(f"fft_phase_image: {fft.shape}")
|
| 167 |
|
| 168 |
fft_phase = np.angle(fft)
|
| 169 |
fft_phase = fft_phase + np.pi
|
|
|
|
| 171 |
|
| 172 |
# scale 0 to 1
|
| 173 |
fft_phase = (fft_phase - np.min(fft_phase)) / (
|
| 174 |
+
np.max(fft_phase) - np.min(fft_phase) + 1e-6
|
| 175 |
)
|
| 176 |
# scale to (0, 255)
|
| 177 |
fft_phase = fft_phase * 255
|