Code Monkey home page Code Monkey logo

rivagan's People

Contributors

peachypie98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rivagan's Issues

Robustness to horizontal flipping

Hi, thank you for this amazing work of refactoring the original source code of RivaGAN.

I was wondering if you have any suggestion on how to give more robustness to the model against horizontal flipping attacks.

I trained the model, but after some experiments I noticed that flipping the video leads to very poor accuracy in watermark extraction.

I tried to implement a simple noise layer like this:

class HorizontalFlipping(nn.Module):
    """
    Simulates a transformation where the input is mirrored horizontally.

    Input: (N, 3, L, H, W)
    Output: (N, 3, L, H, W)
    """

    def __init__(self):
        super(HorizontalFlipping, self).__init__()

    def forward(self, frames):
        #return frames.flip(dims=(-1,))
        return frames.flip([4]) #flips along the width dimension

and then I added it inside the training and validation code, similarly to the others noise layers already implemented (Crop, Compression, Scale).

The problem is, when I run a new training with such modifications, the various accuracies have a worsening (included the validation crop accuracy, scale accuracy, ...).

Do you have any suggestions?
Thanks a lot

loss一直不收敛

运行了模型 下载了数据 跑了三百论 loss一直是1.3 精度也不高 只有0.6 左右 这种怎么调节去解决 改变了学习率那个loss也降不下

Saving the model with state_dict

Hi, thanks for the amazing work.

I was wondering if you could help me in modifying the code so that the model is saved by using its state_dict, instead of saving the whole model, as PyTorch documentation suggests (https://pytorch.org/tutorials/beginner/saving_loading_models.html).

Since the RivaGAN class does not extend directly the nn.Module, I tought to simply modify it from class RivaGAN(object) to class RivaGAN(nn.Module)

and then change from

torch.save(self, os.path.join(log_dir, "model.pt"))

to

torch.save(self.state_dict(), os.path.join(log_dir, "model.pt"))

but maybe I'm missing something and I can't figure out if it's enough for the model to work properly or if this modification could alter the model behavior when loaded (since the RivaGAN class is composed by multiple sub-modules).

Do you have any suggestion?
Thanks

Checkpoints

Thank you for sharing the code! Do you have trained checkpoints or is there a way to use their official checkpoint, which ends with .onnx? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.