Added actual tensor displaying. Added more tests. Added select channels.
This commit is contained in:
9
examples/effects/select_channels.py
Normal file
9
examples/effects/select_channels.py
Normal file
@ -0,0 +1,9 @@
|
||||
from displayarray.effects import crop
|
||||
from displayarray import display
|
||||
import numpy as np
|
||||
|
||||
# Scroll the mouse wheel and press ctrl, alt, or shift to select which channels are displayed as red, green, or blue.
|
||||
arr = np.ones((250, 250, 250))
|
||||
for x in range(250):
|
||||
arr[..., x] = x / 250.0
|
||||
display(arr).block()
|
@ -1,9 +1,9 @@
|
||||
from displayarray import display
|
||||
import numpy as np
|
||||
|
||||
arr = np.random.normal(0.5, 0.1, (100, 100, 3))
|
||||
arr = np.random.normal(0.5, 0.1, (100, 100, 5))
|
||||
|
||||
with display(arr) as displayer:
|
||||
while displayer:
|
||||
arr[:] += np.random.normal(0.001, 0.0005, (100, 100, 3))
|
||||
arr[:] += np.random.normal(0.001, 0.0005, (100, 100, 5))
|
||||
arr %= 1.0
|
||||
|
@ -39,3 +39,9 @@ while displayer:
|
||||
autoencoder.fit(grab_noise, grab, steps_per_epoch=1, epochs=1)
|
||||
output_image = autoencoder.predict(grab, steps=1)
|
||||
displayer.update((output_image[0] * 255.0).astype(np.uint8), "uid for autoencoder output")
|
||||
|
||||
get_3rd_layer_output = tf.keras.backend.function([autoencoder.layers[0].input],
|
||||
[autoencoder.layers[1].output])
|
||||
layer_output = get_3rd_layer_output([grab_noise])[0]
|
||||
|
||||
displayer.update(layer_output[0], "conv 1")
|
Reference in New Issue
Block a user