-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.py
More file actions
35 lines (31 loc) · 993 Bytes
/
model.py
File metadata and controls
35 lines (31 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
""" Deeplabv3+ model"""
import tensorflow as tf
import xception
import aspp
import deep_lab_decoder
MODEL = tf.keras.Model
def deep_lab_v3(inputs):
"""Implementation of the Deeplabv3+ """
batch_normalization = True
weight_decay = 0.05
result, skip = xception.xception_41(
inputs=inputs,
weight_decay=weight_decay,
batch_normalization=batch_normalization)
result = aspp.aspp(
inputs=result,
input_shape=[480, 640, 3],
weight_decay=weight_decay,
batch_normalization=batch_normalization)
result = deep_lab_decoder.decoder(
inputs=result,
skip=skip,
weight_decay=weight_decay,
batch_normalization=batch_normalization)
result = deep_lab_decoder.get_logits(
inputs=result,
weight_decay=weight_decay,
batch_normalization=batch_normalization,
low_memory=False)
model = MODEL(inputs=inputs, outputs=result, name='Deeplabv3plus')
return model