DeepTextSpotter icon indicating copy to clipboard operation
DeepTextSpotter copied to clipboard

Understanding cropping process (net.layers[0].get_crop())

Open leetwito opened this issue 8 years ago • 3 comments

Hi, I'm trying to adapt the 'Train.py' for evaluation. In the 'process_batch' function there's a cropping process, using:

net.layers[0].get_crop()

which returns random coordinates for cropping the image. I understand that during the train process, these crops are serving as augmentations of the data. I would like to disable this augmentation, as it disrupt the forward pass when validating. Just removing these lines ruins the results totally. The function is 'get' so I assume the crop happens somewhere in the architecture, but I can't locate it.

The relevant code section is from train.py -> process batch: image

Thanks, Lee.

leetwito avatar Mar 07 '18 09:03 leetwito

Hi, implementation is here: src/caffe/layers/ondisk_data_layer.cpp ,

so you can "if" random_rotation(img, boxes, txt); random_crop(img, boxes, txt, crop_ratio, crops); when phase is not TRAIN

Michal

MichalBusta avatar Mar 07 '18 12:03 MichalBusta

@MichalBusta I want to retrain. But I don't know how to prepare the data. I cannot find the " src/caffe/layers/ondisk_data_layer.cpp" you mentioned.

Could you give a brief instruction?

yang-fei avatar Mar 27 '18 02:03 yang-fei

Hi,

data preparation:

https://github.com/MichalBusta/DeepTextSpotter/issues/10

"src/caffe/layers/ondisk_data_layer.cpp" you mentioned." - https://github.com/MichalBusta/caffe/blob/darknet/src/caffe/layers/ondisk_data_layer.cpp

Michal

On 03/27/2018 04:16 AM, Fei Yang wrote:

@MichalBusta https://github.com/MichalBusta I want to retrain. But I don't know how to prepare the data. I cannot find the " src/caffe/layers/ondisk_data_layer.cpp" you mentioned.

Could you give a brief instruction?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MichalBusta/DeepTextSpotter/issues/20#issuecomment-376373482, or mute the thread https://github.com/notifications/unsubscribe-auth/AD6jsMtoGcRWxkPi0vcls5OQ8BtT7Isxks5tiaEAgaJpZM4SgIFx.

MichalBusta avatar Mar 27 '18 09:03 MichalBusta