FasterRCNNTutorial icon indicating copy to clipboard operation
FasterRCNNTutorial copied to clipboard

test on larger images

Open elifbykl opened this issue 7 years ago • 10 comments

Hi jaspereb,

I have trained the faster-rcnn model on size of 600x600 images and the result is quite good in 600x600 size. But when I test on a larger size image of 1024x1024, the success is very low. What would be the reason?

elifbykl avatar Apr 16 '18 19:04 elifbykl

A couple of questions: -are they the same images? so you are taking a 1024x1024 image and resizing it when you say 600x600? -did you resize them to 600x600 when training the model? -was all your resizing through scaling or did you crop them instead?

jaspereb avatar Apr 18 '18 23:04 jaspereb

I cropped 600x600 size images from very large size images. I used them in training. I want to give results in bigger images during the test phase. So, I cropped 1024x1024 size images from large size images again. I used them in testing. I didn't apply any resizing.

elifbykl avatar Apr 19 '18 06:04 elifbykl

It sounds like the objects might be too small after resizing, are they quite small to begin with?

What i mean is that, because the model internally resizes images using the keep_aspect_ratio_resizer code, it will reduce the object size if your images are > 600x600. So if you pass it a 1024x1024 image with small objects, these will become even smaller (0.586 times the original size) once it is resized by the model. If you crop an image to 600x600 prior to passing it in, then this won't happen and the objects will stay their original size.

jaspereb avatar Apr 20 '18 07:04 jaspereb

Hi All,

I also got an issue like @elifbykl, I do have such large images 8192 by 4096 px.

instead of weed detection, I would like to apply for vehicle number plates. in that case, if I crop the images and resize by 600 x 1200. it's working on small images, But not on the big images.

What would be the best way to follow. what would be the best setting and way to annotate the images.

ozcan-durak avatar May 06 '19 10:05 ozcan-durak

You need to crop and resize the images for both training and testing, is that what you mean by 'not on the big images'?

1200x600 would be reasonable, you just need to work out how many tiles to use so that the number plates are > approx 30x30 pixels after cropping

jaspereb avatar May 07 '19 00:05 jaspereb

I have cropped and resized the images for both training and testing, and made sure that the number plate pixels are above 30 x 30 pixels.

It can predict on small images but still not detecting on 8192x4096. Really stuck at that point.

ozcan-durak avatar May 07 '19 11:05 ozcan-durak

hmm, are you using the same workflow for formatting both datasets, ie not accidentally swapping RGB to BGR or something? how are you inputting 8192x4096, are you cropping to the number plate region? or tiling them?

jaspereb avatar May 07 '19 23:05 jaspereb

Yes they all from same workflow, Taken with the same camera and they all in RGB.

I have been cropping the number plate region and tried, this way its working on small images. I have not tried tiling yet. But tried on to train on 8192 x 4096 on google cloud servers which require huge resource and the result still not accurate.

ozcan-durak avatar May 08 '19 07:05 ozcan-durak

Most object detectors will struggle on such large images, at the very least you would need to increase the anchor sizes and possibly convolution windows to keep the receptive fields of the various network components reasonable.

jaspereb avatar May 12 '19 11:05 jaspereb

Thanks @jaspereb, I have resolved the problem with large images.

@elifbykl if you still have an issue with large images I may be able to help you. Get in touch.

ozcan-durak avatar Aug 16 '19 16:08 ozcan-durak