Git Product home page Git Product logo

shadow-removal-via-generative-priors's Issues

No such file or directory: lpips/weights/v0.1/vgg.pth

Hi there, ML noob here.

I am trying to run the code in this repository on Google Colab. I have downloaded the two checkpoints provided in your drive and installed all necessary libraries.

Unfortunately, when I run bash run.sh I receive the following error message:

target img path: imgs/9165-006-input.png
Downloading: "https://download.pytorch.org/models/resnet18-5c106cde.pth" to /root/.cache/torch/hub/checkpoints/resnet18-5c106cde.pth
100% 44.7M/44.7M [00:00<00:00, 99.4MB/s]
Setting up Perceptual loss...
Downloading: "https://download.pytorch.org/models/vgg16-397923af.pth" to /root/.cache/torch/hub/checkpoints/vgg16-397923af.pth
100% 528M/528M [00:04<00:00, 132MB/s] 
Loading model from: /content/drive/MyDrive/Shadow-Removal-via-Generative-Priors/lpips/weights/v0.1/vgg.pth
Traceback (most recent call last):
  File "remove_shadow.py", line 379, in <module>
    main(img_path, res_dir, args.device, args)
  File "remove_shadow.py", line 166, in main
    model="net-lin", net="vgg", use_gpu=device.startswith("cuda")
  File "/content/drive/MyDrive/Shadow-Removal-via-Generative-Priors/lpips/__init__.py", line 22, in __init__
    self.model.initialize(model=model, net=net, use_gpu=use_gpu, colorspace=colorspace, spatial=self.spatial, gpu_ids=gpu_ids)
  File "/content/drive/MyDrive/Shadow-Removal-via-Generative-Priors/lpips/dist_model.py", line 73, in initialize
    self.net.load_state_dict(torch.load(model_path, **kw), strict=False)
  File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 699, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 231, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 212, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/content/drive/MyDrive/Shadow-Removal-via-Generative-Priors/lpips/weights/v0.1/vgg.pth'

The error is thrown in line 73 of lpips/dist_model.py. The code I ran does download a vgg16 checkpoint file called vgg16-397923af.pth, so I tried hardcoding the path to this file into line 69 of lpips/dist_model.py. No error is thrown after hardcoding this path, but the output of the network after doing so is very strange:
Screen Shot 2022-06-23 at 4 30 29 PM

This presumably means that hardcoding vgg16-397923af.pth into line 73 was incorrect, especially since in your paper, you use a VGG-19 network.

Should I expect the path lpips/weights/v0.1/vgg.pth to exist after I've run bash run.sh? Was I supposed to include it before hand and if so, where do I download it from?

Thanks!

Dissimilar results. Ideas on approach?

Hello Yingqing, Nice work.

We tested the project and had a few questions.

After passing an input image with similar shadowing as your test cases, we could not achieve the same results. Currently, we change the iterations to double but noticed the shadow map has no variation above the 1st 5 or so. Are there any settings that iterate through more permutations of shadow masks?

How to find (shadow) relevant features in the latent space?

Hello, I'm currently trying to implement the first step of your proposed algorithm (input: portrait image, face mask, output: shadow free image). I successfully created the face mask with the Bisenet and removed the background from the portrait image. In the next step I received the latent vectors from StyleGAN.

My question now is: How do you explore the latent space to find the relevant parts of the vector which control the shadows? You create K random latent vectors but what is your strategy? How many values do you manipulate in every sample? Any hint would be very helpful to me! Thanks in advance.

About Datasets.

Thanks for sharing your code! And could you please release the datasets of tattoo and watermark removal?

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.