vt-vl-lab / 3d-photo-inpainting

[CVPR 2020] 3D Photography using Context-aware Layered Depth Inpainting
https://shihmengli.github.io/3D-Photo-Inpainting/
Other
6.88k stars 1.11k forks source link

Add support to run on Windows #187

Closed donlinglok1 closed 3 months ago

donlinglok1 commented 1 year ago

Need to install Git BASH to run.

sh download.sh

Ref: https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/4268#discussioncomment-4134100

visualinventor commented 1 year ago

I just tried this branch on a windows 10 machine and it failed. I'd love any help getting it to work.

initialize network with normal loading the model from ./pix2pix/checkpoints/mergemodel\latest_net_G.pth Loading weights: midas/model.pt Traceback (most recent call last): File "run.py", line 580, in <module> run(dataset_, option_) File "run.py", line 59, in run midasmodel = MidasNet(midas_model_path, non_negative=True) File "D:\Development\3d-photo-inpainting\BoostingMonocularDepth\midas\models\midas_net.py", line 47, in __init__ self.load(path) File "D:\Development\3d-photo-inpainting\BoostingMonocularDepth\midas\models\base_model.py", line 12, in load parameters = torch.load(path) File "C:\ProgramData\Anaconda3\envs\3DP\lib\site-packages\torch\serialization.py", line 527, in load with _open_zipfile_reader(f) as opened_zipfile: File "C:\ProgramData\Anaconda3\envs\3DP\lib\site-packages\torch\serialization.py", line 224, in __init__ super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer)) RuntimeError: version_ <= kMaxSupportedFileFormatVersion INTERNAL ASSERT FAILED at ..\caffe2\serialize\inline_container.cc:132, please report a bug to PyTorch. Attempted to read a PyTorch file with version 3, but the maximum supported version for reading is 2. Your PyTorch installation may be too old. (init at ..\caffe2\serialize\inline_container.cc:132) (no backtrace available) 0%| | 0/1 [00:06<?, ?it/s] Current Source ==> majesticWoman Running depth extraction at 1670549950.8643239 BoostingMonocularDepth\inputs\*.jpg copy "D:\Development\3d-photo-inpainting\KenBurns\Input\majesticWoman.jpg" "D:\Development\3d-photo-inpainting\BoostingMonocularDepth\inputs\majesticWoman.jpg" Traceback (most recent call last): File "main.py", line 58, in <module> run_boostmonodepth(sample['ref_img_fi'], config['src_folder'], config['depth_folder']) File "D:\Development\3d-photo-inpainting\boostmonodepth_utils.py", line 46, in run_boostmonodepth depth = imageio.imread(os.path.join(BOOST_BASE, BOOST_OUTPUTS, tgt_name)) File "C:\ProgramData\Anaconda3\envs\3DP\lib\site-packages\imageio\__init__.py", line 97, in imread return imread_v2(uri, format=format, **kwargs) File "C:\ProgramData\Anaconda3\envs\3DP\lib\site-packages\imageio\v2.py", line 200, in imread with imopen(uri, "ri", **imopen_args) as file: File "C:\ProgramData\Anaconda3\envs\3DP\lib\site-packages\imageio\core\imopen.py", line 118, in imopen request = Request(uri, io_mode, format_hint=format_hint, extension=extension) File "C:\ProgramData\Anaconda3\envs\3DP\lib\site-packages\imageio\core\request.py", line 248, in __init__ self._parse_uri(uri) File "C:\ProgramData\Anaconda3\envs\3DP\lib\site-packages\imageio\core\request.py", line 407, in _parse_uri raise FileNotFoundError("No such file: '%s'" % fn) FileNotFoundError: No such file: 'D:\Development\3d-photo-inpainting\BoostingMonocularDepth\outputs\majesticWoman.png'

donlinglok1 commented 1 year ago

please report a bug to PyTorch. Attempted to read a PyTorch file with version 3, but the maximum supported version for reading is 2. Your PyTorch installation may be too old.

Hum, I didn't have that error message before, maybe this is some kind of dependencies version problem?

First you may checkout the dependencies version, here is my list https://github.com/AUTOMATIC1111/stable-diffusion-webui/files/9945044/piplist.txt

Also some discussions here: https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/4268#discussioncomment-4067030

Then you may try on this colab or use the master branch code and see if your input image can work: https://colab.research.google.com/drive/1DEySGgVdZtpdy3aP0xP8Sa4yvYTxxV_y?usp=sharing

https://github.com/donlinglok/3d-photo-inpainting/commits/master

Straafe commented 1 year ago

Got any ideas for this error? Tried several forks and versions of torch/cuda, can't seem to get around it on Windows


    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 2575: character maps to <undefined>