yingqinghe / shadow-removal-via-generative-priors Goto Github PK
View Code? Open in Web Editor NEW[ACM MM 2021 Oral] Unsupervised Portrait Shadow Removal via Generative Priors
License: Other
[ACM MM 2021 Oral] Unsupervised Portrait Shadow Removal via Generative Priors
License: Other
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:
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!
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?
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.
Thank you and I think I understand know
Hello, could you provide the training script? I would like to train a 512x512 model. A pretrained model would also be great :) Thanks!
Thanks for sharing your code! And could you please release the datasets of tattoo and watermark removal?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.