图像自动字幕与人体姿态估计的深度学习实现
1. 图像自动字幕模型构建
1.1 模型架构
图像自动字幕模型的架构灵感来源于 “Show, Attend and Tell” 论文。首先,从 Inception - v3 的较低卷积层提取特征,得到形状为 (8, 8, 2048) 的向量,然后将其压缩为 (64, 2048) 的形状。该向量会通过由单个全连接层组成的 CNN 编码器,接着使用 RNN(这里是 GRU)对图像进行关注以预测下一个单词。
def gru(units):
if tf.test.is_gpu_available():
return tf.keras.layers.CuDNNGRU(units,
return_sequences=True,
return_state=True,
recurrent_initializer='glorot_uniform')
else:
return tf.keras.layers.GRU(units,
return_sequences=True,
return_state=True,
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



