ZF4444 / MMAL-Net

This is a PyTorch implementation of the paper "Multi-branch and Multi-scale Attention Learning for Fine-Grained Visual Categorization (MMAL-Net)" (Fan Zhang, Meng Li, Guisheng Zhai, Yizhao Liu).
249 stars 57 forks source link

Config for custom datasets #6

Closed huytran97 closed 4 years ago

huytran97 commented 4 years ago

Hi, Thank you for your great work. I have a question about training on other datasets: How can I change the window_size and ratio for different kinds of data.

Thank you.

ZF4444 commented 4 years ago

Hi! You just need to adjust this line for first window size, https://github.com/ZF1044404254/TBMSL-Net/blob/f5b442d1226b0a3afa365c09895ec025b578de15/config.py#L38 ,and next line for second window size, 40th line for third window size. ratio * 32 = window size

Don't forget to adjust https://github.com/ZF1044404254/TBMSL-Net/blob/f5b442d1226b0a3afa365c09895ec025b578de15/config.py#L67 accord your ratios' config. For example, your first size window has 4 different ratios, second size window has 3 different ratios, third size window has 2 different ratios, then it should be window_nums_sum = [0, sum(window_nums[:4]), sum(window_nums[4:4+3]), sum(window_nums[4+3:])]

huytran97 commented 4 years ago

Thank you. How about the window_sizes? How can I adjust it if my images are smaller than 128?

ZF4444 commented 4 years ago

Thank you. How about the window_sizes? How can I adjust it if my images are smaller than 128?

Our code is 448 for the network input. If the input size is 128, the size of the final feature map is 4, which is not conducive to positioning according to the feature map. And the code needs to be adjusted in many places.

huytran97 commented 4 years ago

I see. Thank you very much.