jaspereb / FasterRCNNTutorial

A FasterRCNN Tutorial in Tensorflow
66 stars 33 forks source link

test on larger images #3

Open elifbykl opened 6 years ago

elifbykl commented 6 years ago

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?

jaspereb commented 6 years ago

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?

elifbykl commented 6 years ago

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.

jaspereb commented 6 years ago

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.

ozcan-durak commented 5 years ago

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.

jaspereb commented 5 years ago

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

ozcan-durak commented 5 years ago

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.

jaspereb commented 5 years ago

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?

ozcan-durak commented 5 years ago

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.

jaspereb commented 5 years ago

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.

ozcan-durak commented 5 years ago

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.