xadrianzetx/coral-deeplab

Allow non-square input shape for keras models

Closed this issue · 7 comments

Hello!
It works more or less, thank you! Is it possible to change NN input size to 1600x800?

Hi,

I could push update to allow non square input size. There are no pretrained weights for it, so you'll have to train from scratch.

But in your particular case - I'm not sure if this kind of resolution will work with Edge TPU. I gave it a quick try and compiler failed to create a model.

Sure, I will do experiments
Maybe 800x800 is good solution Than I will divide picture into 2 parts

I had closer look at this and it seems like edgetpu_compiler is not particularly happy about non square inputs for this model (regardless of shape). Since I want to be sure that people using pretrained and finetuned keras model have no problem compiling it to the device, check for square inputs will not be removed.

Got it. It is very interesting why...

Dear @xadrianzetx I noticed before that deeplab recognize some objects better when input is larger. Could you advice how to change from 513x513 to 800x800?

You can create new instance of keras model with input shape you want like so:

import coral_deeplab as cdl

model = cdl.applications.CoralDeepLabV3(input_shape=(800, 800, 3))

As I said earlier, there are no pretrained weights for this shape, so you have to train this model yourself. I think you can use scripts you posted in other issue to do so.

FYI: 800x800 trainubg with Nvidia 1080Ti failed, I have switched to try train 512x512