tfodParameters.inputSize - should it be 300 or 320?


The ftc-ml tool, by default, produces models based on SSD MobileNet v2 320x320. In all the Android Studio samples in the FtcRobotController repo, the initTfod method includes tfodParameters.inputSize = 300;. However, in the Implementing in Robot Code - OnBot Java part of the ftc-ml manual, it suggests tfodParameters.inputSize = 320;. Is there any difference for either the pre-trained signal model or custom signal sleeve models? Both 300 and 320 seem to work.


Recently @lizlooney dug into the details of the 320x320 model zoo model and found out that its name was a lie - the model is actually 300x300. We’re not really sure how much of a difference it makes to specify the true size of 300 or the purported size 320. There likely is a difference, which is why we changed our sample code to reflect the true size (so that we’re being as accurate as possible in the sample) but again we’re not really sure. My gut instinct is that it makes more of a difference (though likely still not significantly impactful) in model Training, but in inference (using it on the Control hub) it probably just means Tensorflow does an additional small scale-down on the image - this may make the model a tiny bit slower, and smaller objects might be slightly more obscured, but you likely wouldn’t notice it.

1 Like