Skip to content

Retrain SSDLite TFlite models on 320x320 input size data

Summary

Picamera requires that output images must be sized in a multiple of 32. This was not known when model input size was fixed at 300x300px. This creates some messyness.

Necessity/problem to solve

As a result, a hack is used to size the saved raw data to 320x320px, and then scale down before inference. This is needless extra compute for every raw frame, takes up more disk space than is required and is generally messy.

Details

An attempt has been made to simply resize the input of the model before quantisation. However, this has resulted in precision/recall loss when compared with the original.

Expected effort

The proper fix to this is to re-train SSDLite Mobilenet v2 models with an input buffer sized 320x320. This should create a model with the correct input buffer size, without as much accuracy loss.

Person hours: I suspect this would take a couple of days

Difficulty: Not too difficult if TF OD API is set up.

I could work on this

Yes, I intend to at some point in the future.