creotiv / hdrnet-pytorch

Unofficial PyTorch implementation of 'Deep Bilateral Learning for Real-Time Image Enhancement', SIGGRAPH 2017 https://groups.csail.mit.edu/graphics/hdrnet/
228 stars 45 forks source link

bilateral_slice #20

Open lichen120 opened 3 years ago

lichen120 commented 3 years ago

how to use the bilateral_slice.cu.cc

creotiv commented 3 years ago

You need to compile it and use as loaded module in pytorch, using bindings in ops dir. But right now it not used, and native pytorch function used instead. Build script for cuda u can find here https://github.com/mgharbi/hdrnet/blob/master/hdrnet/Makefile

Kindly yours, Andrey Nikishaev

Areas ML/DS/CV/Soft Dev/BizDev/Growth Hacking/Customer Rel/IT LinkedIn http://ua.linkedin.com/in/creotiv GitHub http://github.com/creotiv Slideshare https://www.slideshare.net/anikishaev/ AnimalHelp https://patreon.com/uah Telegram @anikishaev Mobile +380632410666

On Fri, Oct 29, 2021 at 5:44 AM lichen120 @.***> wrote:

how to use the bilateral_slice.cu.cc

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/creotiv/hdrnet-pytorch/issues/20, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5CDJXOCAXKPYZZWPFJJLUJIDABANCNFSM5G6I7DEQ . 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&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

lichen120 commented 3 years ago

i use the makefile of https://github.com/mgharbi/hdrnet/blob/master/hdrnet/Makefile ,but i get the problem as below:

ImportError: dynamic module does not define module export function (PyInit__hdrnet_ops)

can you share the install instruction?

At 2021-10-29 16:05:28, "Andrey Nikishaev" @.***> wrote:

You need to compile it and use as loaded module in pytorch, using bindings in ops dir. But right now it not used, and native pytorch function used instead. Build script for cuda u can find here https://github.com/mgharbi/hdrnet/blob/master/hdrnet/Makefile

Kindly yours, Andrey Nikishaev

Areas ML/DS/CV/Soft Dev/BizDev/Growth Hacking/Customer Rel/IT LinkedIn http://ua.linkedin.com/in/creotiv GitHub http://github.com/creotiv Slideshare https://www.slideshare.net/anikishaev/ AnimalHelp https://patreon.com/uah Telegram @anikishaev Mobile +380632410666

On Fri, Oct 29, 2021 at 5:44 AM lichen120 @.***> wrote:

how to use the bilateral_slice.cu.cc

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/creotiv/hdrnet-pytorch/issues/20, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5CDJXOCAXKPYZZWPFJJLUJIDABANCNFSM5G6I7DEQ . 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&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

creotiv commented 3 years ago

i can't do this cause that cuda ops was written for very old TensorFlow, then rebuilt for PyTorch also old. And at some point there was too many errors, so i couldn't build it (im not very good at cuda), that's why i switched to PyTorch native modules

Kindly yours, Andrey Nikishaev

Areas ML/DS/CV/Soft Dev/BizDev/Growth Hacking/Customer Rel/IT LinkedIn http://ua.linkedin.com/in/creotiv GitHub http://github.com/creotiv Slideshare https://www.slideshare.net/anikishaev/ AnimalHelp https://patreon.com/uah Telegram @anikishaev Mobile +380632410666

On Mon, Nov 1, 2021 at 8:34 AM lichen120 @.***> wrote:

i use the makefile of https://github.com/mgharbi/hdrnet/blob/master/hdrnet/Makefile ,but i get the problem as below:

ImportError: dynamic module does not define module export function (PyInit__hdrnet_ops)

can you share the install instruction?

At 2021-10-29 16:05:28, "Andrey Nikishaev" @.***> wrote:

You need to compile it and use as loaded module in pytorch, using bindings in ops dir. But right now it not used, and native pytorch function used instead. Build script for cuda u can find here https://github.com/mgharbi/hdrnet/blob/master/hdrnet/Makefile

Kindly yours, Andrey Nikishaev

Areas ML/DS/CV/Soft Dev/BizDev/Growth Hacking/Customer Rel/IT LinkedIn http://ua.linkedin.com/in/creotiv GitHub http://github.com/creotiv Slideshare https://www.slideshare.net/anikishaev/ AnimalHelp https://patreon.com/uah Telegram @anikishaev Mobile +380632410666

On Fri, Oct 29, 2021 at 5:44 AM lichen120 @.***> wrote:

how to use the bilateral_slice.cu.cc

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/creotiv/hdrnet-pytorch/issues/20, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAB5CDJXOCAXKPYZZWPFJJLUJIDABANCNFSM5G6I7DEQ

. 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&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/creotiv/hdrnet-pytorch/issues/20#issuecomment-955971359, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5CDIILPEG7D35VWZ4NYDUJYYIFANCNFSM5G6I7DEQ . 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&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

lichen120 commented 3 years ago

PyTorch native modules can replace the bilateral_slice with the same operation?grid_upsample?

lichen120 commented 3 years ago

PyTorch native modules can replace the bilateral_slice with the same operation?grid_upsample?

At 2021-11-01 17:25:03, "Andrey Nikishaev" @.***> wrote:

i can't do this cause that cuda ops was written for very old TensorFlow, then rebuilt for PyTorch also old. And at some point there was too many errors, so i couldn't build it (im not very good at cuda), that's why i switched to PyTorch native modules

Kindly yours, Andrey Nikishaev

Areas ML/DS/CV/Soft Dev/BizDev/Growth Hacking/Customer Rel/IT LinkedIn http://ua.linkedin.com/in/creotiv GitHub http://github.com/creotiv Slideshare https://www.slideshare.net/anikishaev/ AnimalHelp https://patreon.com/uah Telegram @anikishaev Mobile +380632410666

On Mon, Nov 1, 2021 at 8:34 AM lichen120 @.***> wrote:

i use the makefile of https://github.com/mgharbi/hdrnet/blob/master/hdrnet/Makefile ,but i get the problem as below:

ImportError: dynamic module does not define module export function (PyInit__hdrnet_ops)

can you share the install instruction?

At 2021-10-29 16:05:28, "Andrey Nikishaev" @.***> wrote:

You need to compile it and use as loaded module in pytorch, using bindings in ops dir. But right now it not used, and native pytorch function used instead. Build script for cuda u can find here https://github.com/mgharbi/hdrnet/blob/master/hdrnet/Makefile

Kindly yours, Andrey Nikishaev

Areas ML/DS/CV/Soft Dev/BizDev/Growth Hacking/Customer Rel/IT LinkedIn http://ua.linkedin.com/in/creotiv GitHub http://github.com/creotiv Slideshare https://www.slideshare.net/anikishaev/ AnimalHelp https://patreon.com/uah Telegram @anikishaev Mobile +380632410666

On Fri, Oct 29, 2021 at 5:44 AM lichen120 @.***> wrote:

how to use the bilateral_slice.cu.cc

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/creotiv/hdrnet-pytorch/issues/20, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAB5CDJXOCAXKPYZZWPFJJLUJIDABANCNFSM5G6I7DEQ

. 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&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/creotiv/hdrnet-pytorch/issues/20#issuecomment-955971359, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5CDIILPEG7D35VWZ4NYDUJYYIFANCNFSM5G6I7DEQ . 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&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

creotiv commented 3 years ago

@lichen120 im not compared them side by side, but based on logic F.grid_sample works in the same way https://github.com/creotiv/hdrnet-pytorch/blob/master/model.py#L38

lichen120 commented 3 years ago

F.grid_sample relized theTrilinear interpolation?

At 2021-11-01 18:16:49, "Andrey Nikishaev" @.***> wrote:

@lichen120 im not compared them side by side, but based on logic F.grid_sample works in the same way https://github.com/creotiv/hdrnet-pytorch/blob/master/model.py#L38

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

creotiv commented 3 years ago

@lichen120 as we figured out yes, but docs are shit. Basically when u use 5D input array for 3d map, and use bilinear interpolation, trilinear interpolation used. Here is discussion: https://github.com/pytorch/pytorch/issues/5565

creotiv commented 2 years ago

ive added bilateral_slice from original repo compiled for jit. But still has some problems with optimization for some reason

shacharp commented 2 years ago

ive added bilateral_slice from original repo compiled for jit. But still has some problems with optimization for some reason

Hey, did you manage to fix those problems?

And note that slice.py uses now torch greater than your 1.1.0 in the requirements (e.g. torch.concat was introduced in torch 1.10.0, and also a problem in meshgrid() that doesn't have 'indexing' argument in 1.1.0 but in 1.10.0 does)

creotiv commented 2 years ago

@shacharp we in war with russia right now, so dont have time on this. But last time i was trying to fix this i added jit compiled code from original repo, but still with no luck. but slicing working ok. I think to understand real problem in this code we need to debug it outputs layer by layer with getting original output as a target. Beside this i really dont know what to do, as i checked everething(

ProNoobLi commented 1 year ago

But still has some problems with optimization for some reason

Hey, bro, How are you right now?