Sxela / ArcaneGAN

ArcaneGAN
MIT License
652 stars 80 forks source link

Will you release the source code? #14

Closed chinsyo closed 2 years ago

chinsyo commented 2 years ago

The operation _weight_norm is unsupported during convert to CoreML model, I've been stuck on this issue for over a month.

Sxela commented 2 years ago

Hi and thank you for your patience!

As stated in the readme, here's the source for the model - https://fastai1.fast.ai/vision.models.unet.html You can remove those layers in pytorch, but I'm not sure it works for jit exported models. I'll take a look in my spare time and get back to you!

chinsyo commented 2 years ago

@Sxela Thanks Alex! I just wondering for sure how I should setup DynamicUnet to load the state dict export from the JIT model.

Sxela commented 2 years ago

I'm afraid that event the raw model won't work with CoreML, as it has unsupported layers such as PixelShuffle. I think the best option would be to distill it into AnimeGANv2 pytorch small model or something like that if you want to run it on edge devices.

I've launched it on tfjs and pytorch mobile, it's kinda slow even with INT8.

chinsyo commented 2 years ago

I've launched it on tfjs and pytorch mobile, it's kinda slow even with INT8.

I checked the coremltools MIL file and it seems to contain support for PixelShuffle, I think it should be possible to implement support for this model indirectly via mil.

Also iOS devices may have enough performance for this because of ANE (Apple Neural Engine), and a similar model AnimeGANv2-Pytorch only takes about 0.4 seconds on iPhone 13.

Can you provide a demo of using it in conjunction with the JIT model?

Sxela commented 2 years ago

I plan on releasing the training notebook, along with a saved *.pth, I'm just a little preoccupied with work rn.

chinsyo commented 2 years ago

Thanks for your help.

endlesswho commented 2 years ago

notebook, along with a saved *.pth, I'm jus

Wonderful works, when will you release your training notebook?

popperwin commented 2 years ago

Hi @Sxela Do you always plan to release your training notebook as you said ? It doesn't matter if the code isn't very clear or if it isn't fully commented out - as long as all the steps are in the same notebook, it would be ok. So you don't need to bother cleaning the code before :)