U-2-Net icon indicating copy to clipboard operation
U-2-Net copied to clipboard

doubt about training datasets resize method

Open xiongzhu666 opened this issue 3 years ago • 3 comments

Hello Mr Xuebin: about the datasets resize method, my training image size is very big(40003000), so I need to resize the image to 320320 offline. but I compare the results of two resize method:

  1. 3 downsampling by image pyramid to 500375 and then resize to 320320 by Linear interpolation
  2. Resize to 320320 from 40003000 by Linear interpolation directly. the results are very different and the second method produce Jagged and Discontinuous as below image

Do you think the difference will effect the model???which method is more reasonable??in your paper you mentiond you resize the image by Linear interpolation. but if the orignal image is too big and it will cause the problem I described just now.

Thanks Best Regards

xiongzhu666 avatar Aug 11 '21 07:08 xiongzhu666

I would like to choose the method 2, resizeing the image to smaller size directly directly. If you want to have higher resolution results, you could try to cascade the U2Net and U2NetP (or your own refine configuration) for coarse low resolution and accurate high resolution prediction and refine progressively.

On Wed, Aug 11, 2021 at 11:52 AM xiongzhu666 @.***> wrote:

Hello Mr Xuebin: about the datasets resize method, my training image size is very big(40003000), so I need to resize the image to 320320 offline. but I compare the results of two resize method:

  1. 3 downsampling by image pyramid to 500375 and then resize to 320320 by Linear interpolation
  2. Resize to 320320 from 40003000 by Linear interpolation directly. the results are very different and the second method produce Jagged and Discontinuous as below [image: image] https://user-images.githubusercontent.com/52955431/128989838-be5ec920-c26f-42d7-9db4-48acde6bf4cc.png

Do you think the difference will effect the model???which method is more reasonable??in your paper you mentiond you resize the image by Linear interpolation. but if the orignal image is too big and it will cause the problem I described just now.

Thanks Best Regards

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xuebinqin/U-2-Net/issues/244, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSGORMRONX5NWQMX6DIXIDT4IT4LANCNFSM5B5ZJX6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

-- Xuebin Qin PhD Department of Computing Science University of Alberta, Edmonton, AB, Canada Homepage:https://webdocs.cs.ualberta.ca/~xuebin/

xuebinqin avatar Aug 12 '21 17:08 xuebinqin

But are you sure you are using the same interpolation algorithms in these two methods. The first image looks like obtained by nearest neighbor algorithm other than bilinear interpolation.

On Thu, Aug 12, 2021 at 9:44 PM Xuebin Qin @.***> wrote:

I would like to choose the method 2, resizeing the image to smaller size directly directly. If you want to have higher resolution results, you could try to cascade the U2Net and U2NetP (or your own refine configuration) for coarse low resolution and accurate high resolution prediction and refine progressively.

On Wed, Aug 11, 2021 at 11:52 AM xiongzhu666 @.***> wrote:

Hello Mr Xuebin: about the datasets resize method, my training image size is very big(40003000), so I need to resize the image to 320320 offline. but I compare the results of two resize method:

  1. 3 downsampling by image pyramid to 500375 and then resize to 320320 by Linear interpolation
  2. Resize to 320320 from 40003000 by Linear interpolation directly. the results are very different and the second method produce Jagged and Discontinuous as below [image: image] https://user-images.githubusercontent.com/52955431/128989838-be5ec920-c26f-42d7-9db4-48acde6bf4cc.png

Do you think the difference will effect the model???which method is more reasonable??in your paper you mentiond you resize the image by Linear interpolation. but if the orignal image is too big and it will cause the problem I described just now.

Thanks Best Regards

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xuebinqin/U-2-Net/issues/244, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSGORMRONX5NWQMX6DIXIDT4IT4LANCNFSM5B5ZJX6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

-- Xuebin Qin PhD Department of Computing Science University of Alberta, Edmonton, AB, Canada Homepage:https://webdocs.cs.ualberta.ca/~xuebin/

-- Xuebin Qin PhD Department of Computing Science University of Alberta, Edmonton, AB, Canada Homepage:https://webdocs.cs.ualberta.ca/~xuebin/

xuebinqin avatar Aug 12 '21 17:08 xuebinqin

But are you sure you are using the same interpolation algorithms in these two methods. The first image looks like obtained by nearest neighbor algorithm other than bilinear interpolation. On Thu, Aug 12, 2021 at 9:44 PM Xuebin Qin @.> wrote: I would like to choose the method 2, resizeing the image to smaller size directly directly. If you want to have higher resolution results, you could try to cascade the U2Net and U2NetP (or your own refine configuration) for coarse low resolution and accurate high resolution prediction and refine progressively. On Wed, Aug 11, 2021 at 11:52 AM xiongzhu666 @.> wrote: > Hello Mr Xuebin: > about the datasets resize method, my training image size is very big(40003000), > so I need to resize the image to 320320 offline. but I compare the > results of two resize method: > > 1. 3 downsampling by image pyramid to 500375 and then resize to 320320 > by Linear interpolation > 2. Resize to 320320 from 40003000 by Linear interpolation directly. > the results are very different and the second method produce Jagged > and Discontinuous as below > [image: image] > https://user-images.githubusercontent.com/52955431/128989838-be5ec920-c26f-42d7-9db4-48acde6bf4cc.png > > Do you think the difference will effect the model???which method is more > reasonable??in your paper you mentiond you resize the image by Linear > interpolation. but if the orignal image is too big and it will cause the > problem I described just now. > > Thanks > Best Regards > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <#244>, or unsubscribe > https://github.com/notifications/unsubscribe-auth/ADSGORMRONX5NWQMX6DIXIDT4IT4LANCNFSM5B5ZJX6Q > . > Triage notifications on the go with GitHub Mobile for iOS > https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 > or Android > https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email > . > -- Xuebin Qin PhD Department of Computing Science University of Alberta, Edmonton, AB, Canada Homepage:https://webdocs.cs.ualberta.ca/~xuebin/ -- Xuebin Qin PhD Department of Computing Science University of Alberta, Edmonton, AB, Canada Homepage:https://webdocs.cs.ualberta.ca/~xuebin/

Xuebin,Thanks for you reply and I am very appreciate

  1. I will follow your suggestion, I also prefer to resize directly
  2. yes,I used the same resize method by opencv. in fact, I found that when the orignal image size is too large compard with 320, no matter which method of resize I used,it will cause the jagged and discontinuous. Gaussian smoothing was used in pyramid downsampling, so I think that is why it looks very different.
  3. in another issue, I noticed that you suggest and write "RES: You can increase either M or the output filter numbers of each RSU as well as the number of layers “L”, when you use bigger size input than 320x320." I will try to modify the model

Thanks for your patience and help us a lot~!

xiongzhu666 avatar Aug 13 '21 02:08 xiongzhu666