Spaces:
Build error
Build error
Update main.py
Browse files
main.py
CHANGED
|
@@ -3,36 +3,12 @@ import keras # for network
|
|
| 3 |
import gradio # for interface
|
| 4 |
import matplotlib.pyplot # for colormap
|
| 5 |
import matplotlib.colors # for color conversion
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
-
# model1 = keras.models.Sequential()
|
| 9 |
-
# model1.add(keras.layers.InputLayer(input_shape=(101, 636, 1)))
|
| 10 |
-
# model1.add(keras.layers.Conv2D(4, (9, 9), activation='relu', padding='same', strides=1))
|
| 11 |
-
# model1.add(keras.layers.Conv2D(4, (9, 9), activation='relu', padding='same'))
|
| 12 |
-
# model1.add(keras.layers.Conv2D(8, (7, 7), activation='relu', padding='same', strides=1))
|
| 13 |
-
# model1.add(keras.layers.Conv2D(8, (7, 7), activation='relu', padding='same'))
|
| 14 |
-
# model1.add(keras.layers.Conv2D(16, (5, 5), activation='relu', padding='same'))
|
| 15 |
-
# model1.add(keras.layers.Conv2D(16, (5, 5), activation='relu', padding='same', strides=1))
|
| 16 |
-
# model1.add(keras.layers.Conv2D(16, (3, 3), activation='relu', padding='same'))
|
| 17 |
-
# model1.add(keras.layers.Conv2D(16, (3, 3), activation='relu', padding='same', strides=1))
|
| 18 |
-
# model1.add(keras.layers.Conv2D(16, (2, 2), activation='relu', padding='same'))
|
| 19 |
-
# model1.add(keras.layers.Conv2D(16, (2, 2), activation='relu', padding='same', strides=1))
|
| 20 |
-
# model1.add(keras.layers.UpSampling2D((1, 1)))
|
| 21 |
-
# model1.add(keras.layers.Conv2D(16, (2, 2), activation='relu', padding='same'))
|
| 22 |
-
# model1.add(keras.layers.UpSampling2D((1, 1)))
|
| 23 |
-
# model1.add(keras.layers.Conv2D(8, (3, 3), activation='relu', padding='same'))
|
| 24 |
-
# model1.add(keras.layers.UpSampling2D((1, 1)))
|
| 25 |
-
# model1.add(keras.layers.Conv2D(4, (7, 7), activation='tanh', padding='same'))
|
| 26 |
-
# model1.add(keras.layers.UpSampling2D((1, 1)))
|
| 27 |
-
# model1.add(keras.layers.Conv2D(3, (9, 9), activation='tanh', padding='same'))
|
| 28 |
-
|
| 29 |
-
from huggingface_hub import from_pretrained_keras
|
| 30 |
-
|
| 31 |
-
model1 = from_pretrained_keras("cmudrc/microstructure-colorization")
|
| 32 |
-
|
| 33 |
|
| 34 |
#Loading the weights in the architecture (The file should be stored in the same directory as the code)
|
| 35 |
-
model1.load_weights('modelV13_500trained_1.h5')
|
| 36 |
|
| 37 |
# Get the color map by name:
|
| 38 |
cm = matplotlib.pyplot.get_cmap('RdBu')
|
|
|
|
| 3 |
import gradio # for interface
|
| 4 |
import matplotlib.pyplot # for colormap
|
| 5 |
import matplotlib.colors # for color conversion
|
| 6 |
+
import huggingface_hub
|
| 7 |
|
| 8 |
+
model1 = huggingface_hub.from_pretrained_keras("cmudrc/microstructure-colorization")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
#Loading the weights in the architecture (The file should be stored in the same directory as the code)
|
| 11 |
+
# model1.load_weights('modelV13_500trained_1.h5')
|
| 12 |
|
| 13 |
# Get the color map by name:
|
| 14 |
cm = matplotlib.pyplot.get_cmap('RdBu')
|