Try to use 1920 x 1080 camera resolution as input. It should be downscaled by gstreamer.
Or you can try to run this line (metioned here) in console before running your edgeai script:
media-ctl -d 0 --set-v4l2 '"imx219 6-0010":0[fmt:SRGGB8_1X8/640x480]'