Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -8,7 +8,30 @@ import huggingface_hub # for loading model
|
|
8 |
model1 = huggingface_hub.from_pretrained_keras("cmudrc/microstructure-colorization")
|
9 |
|
10 |
# Get the color map by name:
|
11 |
-
cm = matplotlib.pyplot.get_cmap('RdBu')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
#simple image scaling to (nR x nC) size
|
14 |
def scale(im, nR, nC):
|
|
|
8 |
model1 = huggingface_hub.from_pretrained_keras("cmudrc/microstructure-colorization")
|
9 |
|
10 |
# Get the color map by name:
|
11 |
+
# cm = matplotlib.pyplot.get_cmap('RdBu')
|
12 |
+
# import matplotlib.colors
|
13 |
+
|
14 |
+
cdict = {'red': [[0.00, 0.10, 0.10],
|
15 |
+
[0.17, 0.30, 0.30],
|
16 |
+
[0.33, 0.35, 0.35],
|
17 |
+
[0.50, 1.00, 1.00],
|
18 |
+
[0.75, 0.92, 0.92],
|
19 |
+
[1.00, 0.87, 0.87]],
|
20 |
+
'green': [[0.00, 0.30, 0.30],
|
21 |
+
[0.17, 0.53, 0.53],
|
22 |
+
[0.33, 0.72, 0.72],
|
23 |
+
[0.50, 1.00, 1.00],
|
24 |
+
[0.75, 0.52, 0.52],
|
25 |
+
[1.00, 0.32, 0.32]],
|
26 |
+
'blue': [[0.00, 0.29, 0.29],
|
27 |
+
[0.17, 0.53, 0.53],
|
28 |
+
[0.33, 0.73, 0.73],
|
29 |
+
[0.50, 1.00, 1.00],
|
30 |
+
[0.75, 0.20, 0.20],
|
31 |
+
[1.00, 0.15, 0.15]]}
|
32 |
+
|
33 |
+
|
34 |
+
hamster_colormap = matplotlib.colors.LinearSegmentedColormap('hamster', segmentdata=cdict, N=256)
|
35 |
|
36 |
#simple image scaling to (nR x nC) size
|
37 |
def scale(im, nR, nC):
|