UnityLabs / barracuda-style-transfer

Companion code for the Unity Style Transfer blog post, showcasing realtime style transfer using Barracuda.
https://unity.com/
Other
165 stars 19 forks source link

Cannot access internal struct 'ComputeFunc' here #1

Closed BorisKourt closed 3 years ago

BorisKourt commented 3 years ago

Hi, thanks for the demo.

I was just checking if I could get this to run in 2020.2 under Barracuda 1.2.0-preview but I am getting a set of errors relating to the following:

Assets/BarracudaStyleTransfer/BarracudaStyleTransfer.cs(911,22): error CS0122: 'ComputeFunc' is inaccessible due to its protection level

I assume that this is due to the change in the structure of the library, is there a proper way to update this code for these changes?

EDIT: I am able to run this on version 2020.2 under Barracuda 1.1.2 on the Mac Metal, but not under iOS Metal: https://github.com/Unity-Technologies/barracuda-release/issues/115

Best, Boris

FlorentGuinier commented 3 years ago

Hey @BorisKourt, I'm looking into the compile errors thanks for reporting. PS : For iOS as explained in the other bug this demo was not tested on mobile + we do not expect it to run there atm, i will make this more clear in the repo.

BorisKourt commented 3 years ago

Would you mind giving some tips on getting this to run just enough to do a rough test on iOS?

I have a use-case that don't require the whole frame to be stylized, just regions. Maybe it would be possible to work with at low enough scales.

FlorentGuinier commented 3 years ago

I suppose i would try to run on metal and by disabling as much code as possible and just run the network without anything rendering related. Finally run only one layer a frame + log the progress to see how it goes, and if it fail at what point. All of that said i fear that even at lower resolution performance might not be acceptable on many device.

BorisKourt commented 3 years ago

Okay, I will give that a shot and report back.

FlorentGuinier commented 3 years ago

Fixed via https://github.com/UnityLabs/barracuda-style-transfer/commit/76d82f4fd032156e1bbd84add59736098fbe0209 However when fixing i dicovered a regression in term of loading time in the particular case of this demo on 1.2.0. This is fix on Barracuda repo however demo will thus continue to be on 1.1.2 until the fix reach an official release or patch.

BorisKourt commented 3 years ago

Thanks, will await updates.

FlorentGuinier commented 3 years ago

FYI repo was just updated to 1.2.1 fix is in.

BorisKourt commented 3 years ago

Thank you