CNN对象定位

时间:2019-04-04 17:04:07

标签: python machine-learning keras deep-learning conv-neural-network

我有图像数据集(24 x 24)。我想为每个图像中的每个对象预测@Override protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); clearApplicationData(); } public void clearApplicationData() { File cache = getCacheDir(); File appDir = new File(cache.getParent()); if (appDir.exists()) { String[] children = appDir.list(); for (String s : children) { if (!s.equals("lib")) { deleteDir(new File(appDir, s)); Log.i("EEEEEERRRRRRROOOOOOORRRR", "**************** File /data/data/APP_PACKAGE/" + s + " DELETED *******************"); } } } } public static boolean deleteDir(File dir) { if (dir != null && dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { boolean success = deleteDir(new File(dir, children[i])); if (!success) { return false; } } } return dir.delete(); } center_x。我有一个文件,其中包含图像中每个对象的center_ycenter_x

每个图像中的对象数小于或等于2。

我试图在最后一层使用具有“线性”激活功能的卷积神经网络解决此问题,但效果并不理想。

center_y

输出:

model = Sequential()
model.add(Conv2D(80, 3 ,activation='relu',input_shape=(24,24,3)))
model.add(Conv2D(64,3  , activation='relu' ))
model.add(MaxPool2D(2,2))
model.add(Conv2D(64,3  , activation='relu' ))
model.add(MaxPool2D(2,2)) 
model.add(Conv2D(128,1  , activation='relu' ))
model.add(Flatten())   
model.add(Dense(128, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(4, activation = 'linear')) 
  1. 如果图像中没有对象,则输出为:[0,0,0,0]
  2. 如果图像中有一个对象,则输出为:[value_x,value_y,0,0]

  3. 如果图像中有两个对象,则     输出将是:[value_x,value_y,value_x2,value_y2]

该问题如何解决?

0 个答案:

没有答案