Spaces:
Runtime error
Runtime error
Commit
·
8b5218a
1
Parent(s):
056188b
added dce-net
Browse files
enhance_me/zero_dce/models/__init__.py
ADDED
|
File without changes
|
enhance_me/zero_dce/models/dce_net.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import tensorflow as tf
|
| 2 |
+
from tensorflow.keras import layers, Input, Model
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def build_dce_net() -> Model:
|
| 6 |
+
input_image = Input(shape=[None, None, 3])
|
| 7 |
+
conv1 = layers.Conv2D(
|
| 8 |
+
32, (3, 3), strides=(1, 1), activation="relu", padding="same"
|
| 9 |
+
)(input_image)
|
| 10 |
+
conv2 = layers.Conv2D(
|
| 11 |
+
32, (3, 3), strides=(1, 1), activation="relu", padding="same"
|
| 12 |
+
)(conv1)
|
| 13 |
+
conv3 = layers.Conv2D(
|
| 14 |
+
32, (3, 3), strides=(1, 1), activation="relu", padding="same"
|
| 15 |
+
)(conv2)
|
| 16 |
+
conv4 = layers.Conv2D(
|
| 17 |
+
32, (3, 3), strides=(1, 1), activation="relu", padding="same"
|
| 18 |
+
)(conv3)
|
| 19 |
+
int_con1 = layers.Concatenate(axis=-1)([conv4, conv3])
|
| 20 |
+
conv5 = layers.Conv2D(
|
| 21 |
+
32, (3, 3), strides=(1, 1), activation="relu", padding="same"
|
| 22 |
+
)(int_con1)
|
| 23 |
+
int_con2 = layers.Concatenate(axis=-1)([conv5, conv2])
|
| 24 |
+
conv6 = layers.Conv2D(
|
| 25 |
+
32, (3, 3), strides=(1, 1), activation="relu", padding="same"
|
| 26 |
+
)(int_con2)
|
| 27 |
+
int_con3 = layers.Concatenate(axis=-1)([conv6, conv1])
|
| 28 |
+
x_r = layers.Conv2D(24, (3, 3), strides=(1, 1), activation="tanh", padding="same")(
|
| 29 |
+
int_con3
|
| 30 |
+
)
|
| 31 |
+
return Model(inputs=input_image, outputs=x_r)
|