【问题标题】:TensorFlow, Keras: Test Image Larger Than Training ImagesTensorFlow、Keras:测试图像大于训练图像
【发布时间】:2018-09-23 09:17:39
【问题描述】:

我已经训练了一个网络来检测 14x14 像素灰度图像中的“气泡”。我用包含气泡的图像和不包含气泡的图像训练了网络。网络运行良好。

现在,我有一个带有很多气泡的大图像(我从这个大图像生成了训练数据)1

我希望网络使用 14x14 内核扫描大图像以检测气泡的位置。我该怎么做?

下面是我的网络:

model = keras.Sequential([
    keras.layers.Flatten(input_shape=(14, 14)),
    keras.layers.Dense(128, activation=tf.nn.relu),
    keras.layers.Dense(64, activation=tf.nn.relu),
    keras.layers.Dense(32, activation=tf.nn.relu),
    keras.layers.Dense(16, activation=tf.nn.relu),
    keras.layers.Dense(8, activation=tf.nn.relu),
    keras.layers.Dense(2, activation=tf.nn.softmax)
])
model.compile(optimizer=tf.train.AdamOptimizer(), 
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy'])

【问题讨论】:

    标签: image tensorflow keras


    【解决方案1】:

    我认为您无法使用您正在使用的架构检测气泡的位置。您必须使您的案例适应 YOLO 之类的算法:https://medium.com/@jonathan_hui/real-time-object-detection-with-yolo-yolov2-28b1b93e2088。然后,您的输出将包含一个指示特定区域中是否存在气泡的单位,以及一组定义气泡坐标的单位。

    【讨论】:

    • 看来yolo正是我需要的!谢谢!但我不想标记对象,而是想获得它们的中心位置。我确定有可能对 yolo 进行编辑以获得中心位置。
    猜你喜欢
    • 2014-01-22
    • 2017-06-09
    • 2017-04-06
    • 2017-11-28
    • 1970-01-01
    • 2021-03-12
    • 1970-01-01
    • 2017-06-19
    • 1970-01-01
    相关资源
    最近更新 更多