Any good code for inference segmentation?

One relevant note from another thread - you can solve the size issue as follows: