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

Improving Edges quality

Open PushpakBhoge opened this issue 3 years ago • 7 comments

First of all Amazing architecture, This architecture can get Amazing results on many other applications. I see that we are resizing images to 320x320 won't it affect edges for wider aspect ratios like 1280x720? Will Training the model on ratio of 16:9 will improve the edges? Also out of curiosity, Why did you chose this normalisation scheme instead of usual divided by 255?

PushpakBhoge avatar May 31 '21 20:05 PushpakBhoge

Thanks for your interests. The edge quality depends on the image resolution. For example, if your original image size is 3200x3200, reducing it to 320x320 will degrade the edge quality. Because the resizing operation lost many details. For the large aspect ratio, such as 1280x720, with small resizing scale(<4), the edge quality should be ok. Because the training dataset also contains the image with different aspect ratio.

Why did you chose this normalisation scheme instead of usual divided by 255? RE: It is just based on our experiences for normalizing different results adaptively. It won't greatly influence the performance.

xuebinqin avatar Jun 01 '21 06:06 xuebinqin

Thank you for the reply one last question let's say targetted resolution is 1280x720, I trained a model on 720x720. but when I resize them back to 1280x720 won't the edges of the mask will be stretched more horizontally relative to vertical? to negate this if during inference I fed 1280x720 to model instead of 720x720 will that work? or I have to train the entire model on 1280x720? what are your thoughts on this?

PushpakBhoge avatar Jun 01 '21 07:06 PushpakBhoge

According to our experiences, resizing scales less than 4 won't influence the edge accuracy that much except for that your edge width is smaller than 4 in that case. You can train that on 1280x720, but the changing on input size will lead to the variations on receptive fields, which might degrades the overall performance. Of course, it also depends on the relative size of your targets. Anyway, you can give it a try. Without experiments, no one can give deterministic conclusions. Best of luck!

xuebinqin avatar Jun 01 '21 12:06 xuebinqin

Thank you so much for your help! I think this architecture has a lot of potential in other areas as well. like object Detection as well as fine-grained classification (encoder) will be experimenting with those will let you know if got some good results. I was thinking to create a training repo (from fork of this ) so anyone with little programming knowledge can train model easily on their data, does that works for you ?

PushpakBhoge avatar Jun 04 '21 07:06 PushpakBhoge

Thanks for your interest and pls feel free to give it a try. That would be very helpful.

On Fri, Jun 4, 2021 at 11:54 AM PushpakBhoge @.***> wrote:

Thank you so much for your help! I think this architecture has a lot of potential in other areas as well. like object Detection as well as fine-grained classification (encoder) will be experimenting with those will let you know if got some good results. I was thinking to create a training repo (from fork of this ) so anyone with little programming knowledge can train model easily on their data, does that works for you ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/xuebinqin/U-2-Net/issues/212#issuecomment-854457047, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSGORJRRIFYOH62ABS5VELTRCBCHANCNFSM453N3LOQ .

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

xuebinqin avatar Jun 04 '21 13:06 xuebinqin

Thank you so much for your help! I think this architecture has a lot of potential in other areas as well. like object Detection as well as fine-grained classification (encoder) will be experimenting with those will let you know if got some good results. I was thinking to create a training repo (from fork of this ) so anyone with little programming knowledge can train model easily on their data, does that works for you ?

Hi. Did you get better result with 1280*720 trainig ?

majidmobini avatar Sep 07 '22 08:09 majidmobini

Yes but there is a cache it only give good results when inference is done on 1280x720

PushpakBhoge avatar Sep 08 '22 14:09 PushpakBhoge