thygate / stable-diffusion-webui-depthmap-script

High Resolution Depth Maps for Stable Diffusion WebUI
MIT License
1.71k stars 159 forks source link

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate? #175

Open thygate opened 1 year ago

thygate commented 1 year ago

Discussed in https://github.com/thygate/stable-diffusion-webui-depthmap-script/discussions/174

Originally posted by **xjerixx** April 12, 2023 Hello, I posted earlier about the Depth tab not showing up, after trying a lot of various ways of fixing it from stuff I've found online, it seems inputting homebrew commands to install ffmpeg worked, I can now see the depth tab. However when I go to generate a depth map, I get this new error. Any thoughts on how this can be fixed? Thank you so much for your time and patience with me on this. ``` DepthMap v0.3.11 device: cpu Loading model weights from ./models/leres/res101.pth Downloading https://cloudstor.aarnet.edu.au/plus/s/lTIJF4vrvHCAI31/download to ./models/leres/res101.pth Error completing request Arguments: (0, , None, '', '', 1, 0, 512, 512, False, True, False, False, 0, 1, False, 1, True, True, False, False, ['left-right', 'red-cyan-anaglyph'], 2.5, 'polylines_sharp', 0, True, True, False, False, False, 'u2net', False, 0, 2, False, None, True, False, True, False) {} Traceback (most recent call last): File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1348, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1283, in request self._send_request(method, url, body, headers, encode_chunked) File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1329, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1278, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1038, in _send_output self.send(msg) File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 976, in send self.connect() File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1455, in connect self.sock = self._context.wrap_socket(self.sock, File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket return self.sslsocket_class._create( File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1071, in _create self.do_handshake() File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1342, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/ivan_timofejev/stable-diffusion-webui/modules/call_queue.py", line 56, in f res = list(func(*args, **kwargs)) File "/Users/ivan_timofejev/stable-diffusion-webui/modules/call_queue.py", line 37, in f res = func(*args, **kwargs) File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 1110, in run_generate outputs, mesh_fi, meshsimple_fi = run_depthmap( File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 322, in run_depthmap download_file(model_path,"https://cloudstor.aarnet.edu.au/plus/s/lTIJF4vrvHCAI31/download") File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 1305, in download_file torch.hub.download_url_to_file(url, filename) File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/hub.py", line 593, in download_url_to_file u = urlopen(req) File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen return opener.open(url, data, timeout) File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open response = self._open(req, data) File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain result = func(*args) File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open return self.do_open(http.client.HTTPSConnection, req, File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open raise URLError(err) urllib.error.URLError: Traceback (most recent call last): File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 394, in run_predict output = await app.get_blocks().process_api( File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1078, in process_api data = self.postprocess_data(fn_index, result["prediction"], state) File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1012, in postprocess_data prediction_value = block.postprocess(prediction_value) File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/components.py", line 4307, in postprocess "name": self.make_temp_copy_if_needed(y), File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/processing_utils.py", line 362, in make_temp_copy_if_needed temp_dir = self.hash_file(file_path) File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/processing_utils.py", line 334, in hash_file with open(file_path, "rb") as f: FileNotFoundError: [Errno 2] No such file or directory: "
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)>

Time taken: 1.09s

" ```
xjerixx commented 1 year ago

thanks for putting this in the issues section, I'm new to all this and still figuring stuff out

xjerixx commented 1 year ago

I'm not sure where the python 3.10 folder is or even if I have one, this is the only python folder in my applications :

Screenshot 2023-04-12 at 10 49 44 pm

thygate commented 1 year ago

no problem, it is more likely to be picked up by others here.

The answer given in the discussions thread was :

Locate and run the python certificate installer.

It's in /Applications/Python\ 3.10/Install\ Certificates.command

You might need to restart your terminal afterwards, or reboot .. Not sure, but please do try.

3.10 is probably running inside the venv, activate it first then run the pip install certifi ..

xjerixx commented 1 year ago

could you explain this to me in steps please if you don't mind, it's my first time dealing with stuff like this within terminal and where these files are saved

xjerixx commented 1 year ago

I found the python 3.10 folder but when I open it there are a lot of files, none of them being the certificates command

Screenshot 2023-04-12 at 10 57 22 pm Screenshot 2023-04-12 at 10 57 31 pm Screenshot 2023-04-12 at 10 57 39 pm

thygate commented 1 year ago

I have not been on a Mac in over a decade, ..

You have to activate the venv inside the stable-diffusion-webui folder and then with the venv active, run the pip install --upgrade certifi command ..

Otherwise try posting in this thread perhaps, as it is related to your A1111 install. https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/5461

thygate commented 1 year ago

In a terminal, try : (and change the path)

source /path/to/stablediffusion/webui/venv/bin/activate pip3 install certifi --upgrade

xjerixx commented 1 year ago

this is what happens when I do that:

Last login: Wed Apr 12 23:17:15 on ttys001
You have new mail.
ivan_timofejev@Ivans-Mac-mini ~ % source /Users/ivan_timofejev/stable-diffusion-webui/venv/bin/activate
(venv) ivan_timofejev@Ivans-Mac-mini ~ % pip3 install certifi --upgrade
Requirement already satisfied: certifi in ./stable-diffusion-webui/venv/lib/python3.10/site-packages (2022.12.7)
(venv) ivan_timofejev@Ivans-Mac-mini ~ % 
xjerixx commented 1 year ago

I don't know if this helps, but my automatic1111 works fine when generating images, it's having these issues in this extension only

Screenshot 2023-04-12 at 11 20 55 pm

thygate commented 1 year ago

It's an issue with your python environment where it cannot download models because it doesn't recognize the server's ssl certificate. You will likely encounter the same problem when using other functionality that has to download additional models.

For the midas and leres models you could download them manually and place them in your sd/models/midas folder.

xjerixx commented 1 year ago

this is helpful thank you, where can I download those models? all I'm trying to do is what Mick did in this video where he turned images of scenes into a 3d mesh https://www.youtube.com/watch?v=PFybvdKH8hc&ab_channel=Mickmumpitz

thygate commented 1 year ago

save path : download url(s)

models/leres/ : https://cloudstor.aarnet.edu.au/plus/s/lTIJF4vrvHCAI31/download

models/midas : https://github.com/isl-org/MiDaS/releases/download/v3_1/dpt_beit_large_512.pt https://github.com/isl-org/MiDaS/releases/download/v3_1/dpt_beit_large_384.pt https://github.com/intel-isl/DPT/releases/download/1_0/dpt_large-midas-2f21e586.pt https://github.com/intel-isl/DPT/releases/download/1_0/dpt_hybrid-midas-501f0c75.pt https://github.com/AlexeyAB/MiDaS/releases/download/midas_dpt/midas_v21-f6b98070.pt https://github.com/AlexeyAB/MiDaS/releases/download/midas_dpt/midas_v21_small-70d6b9c8.pt

/models/pix2pix : (required for boost) https://sfu.ca/~yagiz/CVPR21/latest_net_G.pth

/models/3dphoto : (required for inpainted mesh) https://filebox.ece.vt.edu/~jbhuang/project/3DPhoto/model/edge-model.pth https://filebox.ece.vt.edu/~jbhuang/project/3DPhoto/model/depth-model.pth https://filebox.ece.vt.edu/~jbhuang/project/3DPhoto/model/color-model.pth

EDIT: Rename the 3dphoto models to use an underscore instead of minus character, eg edge_model.pth

Not possible for the zoedepth models at this moment, you can try using selecting them, maybe torch.hub will be able to download them, but i doubt it, given the missing certificates.

xjerixx commented 1 year ago

Screenshot 2023-04-12 at 11 35 46 pm thank you, downloading now, I'll let you know if the issue persists after I place them in these folders: Screenshot 2023-04-12 at 11 36 16 pm

thygate commented 1 year ago

When the models are in the correct path it will not try to download them and continue.

I encourage you to post in the above mentioned thread to fix your python environment's missing certificates.

thygate commented 1 year ago

downloading all those models at once (you do not need them all) is going to take some time ..

Just get leres and the first 2 midas models to get started maybe ..

You do need the others for the mentioned functionality, so to run 3d inpainting and boost like Mickmumpitz, you need those too.

xjerixx commented 1 year ago

Screenshot 2023-04-12 at 11 44 17 pm aha it's okay, my internet speed picked up ^^

I will report in a few mins to see how they worked out, but just want to say thank you in the mean time for responding so quickly and being patient with me

xjerixx commented 1 year ago

Screenshot 2023-04-12 at 11 51 22 pm it hasn't crashed! thank you so much! I'll update with the results soon

xjerixx commented 1 year ago

would you be able to advise me on what all the models do and which settings I should use for the best results? no worries if not I know you are very busy with more important things :)

xjerixx commented 1 year ago

I spoke too soon aha, I'm gettng this error message now:

DepthMap v0.3.11
device: cpu
Loading model weights from  ./models/leres/res101.pth
initialize network with normal
loading the model from ./models/pix2pix/latest_net_G.pth
Computing depthmap(s) ..
  0%|                                                     | 0/1 [00:00<?, ?it/s]

wholeImage being processed in : 1568
Adjust factor is: 1.0
Selecting patches ...
Target resolution:  (1757, 3136, 3)
Resulting depthmap resolution will be : (748, 1335)
patches to process: 15
     processing patch 0 / 14 | [  0   0 668 668]
     processing patch 1 / 14 | [143   0 668 668]
     processing patch 2 / 14 | [286   0 668 668]
     processing patch 3 / 14 | [429   0 668 668]
     processing patch 4 / 14 | [572   0 668 668]
     processing patch 5 / 14 | [ 68 211 531 531]
     processing patch 6 / 14 | [211 211 531 531]
     processing patch 7 / 14 | [354 211 531 531]
     processing patch 8 / 14 | [497 211 531 531]
     processing patch 9 / 14 | [640 211 531 531]
     processing patch 10 / 14 | [783 211 531 531]
     processing patch 11 / 14 | [  0 286 381 381]
     processing patch 12 / 14 | [286   0 381 381]
     processing patch 13 / 14 | [429   0 381 381]
     processing patch 14 / 14 | [572   0 381 381]
100%|█████████████████████████████████████████████| 1/1 [01:27<00:00, 87.61s/it]
Done.
Running 3D Photo Inpainting .. 
Downloading https://filebox.ece.vt.edu/~jbhuang/project/3DPhoto/model/edge-model.pth to ./models/3dphoto/edge_model.pth
All done.
Error completing request
Arguments: (0, <PIL.Image.Image image mode=RGB size=1335x748 at 0x281FECBB0>, None, '', '', 1, 0, 512, 512, False, True, False, False, 0, 1, False, 1, True, True, False, False, ['left-right', 'red-cyan-anaglyph'], 2.5, 'polylines_sharp', 0, True, True, False, False, False, 'u2net', False, 0, 2, False, None, True, False, True, False) {}
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 976, in send
    self.connect()
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1455, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1071, in _create
    self.do_handshake()
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 767, in run_3dphoto
    download_file(edgemodel_path,"https://filebox.ece.vt.edu/~jbhuang/project/3DPhoto/model/edge-model.pth")
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 1305, in download_file
    torch.hub.download_url_to_file(url, filename)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/hub.py", line 593, in download_url_to_file
    u = urlopen(req)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ivan_timofejev/stable-diffusion-webui/modules/call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "/Users/ivan_timofejev/stable-diffusion-webui/modules/call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 1110, in run_generate
    outputs, mesh_fi, meshsimple_fi = run_depthmap(
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 712, in run_depthmap
    mesh_fi = run_3dphoto(device, inpaint_imgs, inpaint_depths, inputnames, outpath, fnExt, vid_ssaa, inpaint_vids)
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 887, in run_3dphoto
    del rgb_model
UnboundLocalError: local variable 'rgb_model' referenced before assignment

Traceback (most recent call last):
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 394, in run_predict
    output = await app.get_blocks().process_api(
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1078, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1012, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/components.py", line 4307, in postprocess
    "name": self.make_temp_copy_if_needed(y),
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/processing_utils.py", line 362, in make_temp_copy_if_needed
    temp_dir = self.hash_file(file_path)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/processing_utils.py", line 334, in hash_file
    with open(file_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: "<div class='error'>UnboundLocalError: local variable &#x27;rgb_model&#x27; referenced before assignment</div><div class='performance'><p class='time'>Time taken: <wbr>1m 32.41s</p></div>"
thygate commented 1 year ago

Check the README for info on the models, boost, and 3d inpainting.

Boost and leres seems to have been able to generate a depthmap, so both of those seem to be working.

It's now failing on the 3d inpainting trying to download the models again, and fail again because of the missing certificates issue.

Did you place the models in the correct path ? models/3dphoto

xjerixx commented 1 year ago

Screenshot 2023-04-12 at 11 58 54 pm Screenshot 2023-04-12 at 11 59 09 pm Screenshot 2023-04-12 at 11 59 16 pm

I created the 3dphoto folder as there wasn't one before, and then pasted the model files you told me to into there

thygate commented 1 year ago

Well, it tries to download them again because it can't find them there

Downloading https://filebox.ece.vt.edu/~jbhuang/project/3DPhoto/model/edge-model.pth to ./models/3dphoto/edge_model.pth

xjerixx commented 1 year ago

I'm not sure what to do now to fix it, I tried restarting my mac to see if that fixes it but I'm still getting this error:

ivan_timofejev@Ivans-Mac-mini ~ % cd stable-diffusion-webui
ivan_timofejev@Ivans-Mac-mini stable-diffusion-webui % ./webui.sh

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on ivan_timofejev user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Python 3.10.11 (main, Apr  7 2023, 07:24:53) [Clang 14.0.0 (clang-1400.0.29.202)]
Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
Installing requirements for Web UI
Installing imageio-ffmpeg requirement for depthmap script
Installing pyqt6 requirement for depthmap script

Launching Web UI with arguments: --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
No module 'xformers'. Proceeding without it.
==============================================================================
You are running torch 1.12.1.
The program is tested to work with torch 1.13.1.
To reinstall the desired version, run with commandline flag --reinstall-torch.
Beware that this will cause a lot of large files to be downloaded, as well as
there are reports of issues with training tab on the latest version.

Use --skip-version-check commandline argument to disable this check.
==============================================================================
Loading weights [c6bbc15e32] from /Users/ivan_timofejev/stable-diffusion-webui/models/Stable-diffusion/sd-v1-5-inpainting.ckpt
Creating model from config: /Users/ivan_timofejev/stable-diffusion-webui/configs/v1-inpainting-inference.yaml
LatentInpaintDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.54 M params.
Applying cross attention optimization (InvokeAI).
Textual inversion embeddings loaded(0): 
Model loaded in 6.9s (load weights from disk: 1.9s, create model: 0.8s, apply weights to model: 2.0s, apply half(): 1.5s, move model to device: 0.6s).
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 11.4s (import torch: 1.0s, import gradio: 0.7s, import ldm: 0.3s, other imports: 0.7s, load scripts: 1.2s, load SD checkpoint: 7.1s, create ui: 0.2s).

DepthMap v0.3.11
device: cpu
Loading model weights from  ./models/leres/res101.pth
initialize network with normal
loading the model from ./models/pix2pix/latest_net_G.pth
Computing depthmap(s) ..
  0%|                                                     | 0/1 [00:00<?, ?it/s]

wholeImage being processed in : 1568
Adjust factor is: 1.0
Selecting patches ...
Target resolution:  (1757, 3136, 3)
Resulting depthmap resolution will be : (748, 1335)
patches to process: 15
     processing patch 0 / 14 | [  0   0 668 668]
     processing patch 1 / 14 | [143   0 668 668]
     processing patch 2 / 14 | [286   0 668 668]
     processing patch 3 / 14 | [429   0 668 668]
     processing patch 4 / 14 | [572   0 668 668]
     processing patch 5 / 14 | [ 68 211 531 531]
     processing patch 6 / 14 | [211 211 531 531]
     processing patch 7 / 14 | [354 211 531 531]
     processing patch 8 / 14 | [497 211 531 531]
     processing patch 9 / 14 | [640 211 531 531]
     processing patch 10 / 14 | [783 211 531 531]
     processing patch 11 / 14 | [  0 286 381 381]
     processing patch 12 / 14 | [286   0 381 381]
     processing patch 13 / 14 | [429   0 381 381]
     processing patch 14 / 14 | [572   0 381 381]
100%|█████████████████████████████████████████████| 1/1 [01:27<00:00, 87.04s/it]
Done.
Running 3D Photo Inpainting .. 
Downloading https://filebox.ece.vt.edu/~jbhuang/project/3DPhoto/model/edge-model.pth to ./models/3dphoto/edge_model.pth
All done.
Error completing request
Arguments: (0, <PIL.Image.Image image mode=RGB size=1335x748 at 0x29691CFD0>, None, '', '', 1, 0, 512, 512, False, True, False, False, 0, 1, False, 1, True, True, False, False, ['left-right', 'red-cyan-anaglyph'], 2.5, 'polylines_sharp', 0, True, True, False, False, False, 'u2net', False, 0, 2, False, None, True, False, True, False) {}
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 976, in send
    self.connect()
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1455, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1071, in _create
    self.do_handshake()
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 767, in run_3dphoto
    download_file(edgemodel_path,"https://filebox.ece.vt.edu/~jbhuang/project/3DPhoto/model/edge-model.pth")
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 1305, in download_file
    torch.hub.download_url_to_file(url, filename)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/hub.py", line 593, in download_url_to_file
    u = urlopen(req)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ivan_timofejev/stable-diffusion-webui/modules/call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "/Users/ivan_timofejev/stable-diffusion-webui/modules/call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 1110, in run_generate
    outputs, mesh_fi, meshsimple_fi = run_depthmap(
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 712, in run_depthmap
    mesh_fi = run_3dphoto(device, inpaint_imgs, inpaint_depths, inputnames, outpath, fnExt, vid_ssaa, inpaint_vids)
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 887, in run_3dphoto
    del rgb_model
UnboundLocalError: local variable 'rgb_model' referenced before assignment

Traceback (most recent call last):
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 394, in run_predict
    output = await app.get_blocks().process_api(
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1078, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1012, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/components.py", line 4307, in postprocess
    "name": self.make_temp_copy_if_needed(y),
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/processing_utils.py", line 362, in make_temp_copy_if_needed
    temp_dir = self.hash_file(file_path)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/processing_utils.py", line 334, in hash_file
    with open(file_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: "<div class='error'>UnboundLocalError: local variable &#x27;rgb_model&#x27; referenced before assignment</div><div class='performance'><p class='time'>Time taken: <wbr>1m 31.86s</p></div>"
thygate commented 1 year ago

Running 3D Photo Inpainting .. Downloading https://filebox.ece.vt.edu/~jbhuang/project/3DPhoto/model/edge-model.pth to ./models/3dphoto/edge_model.pth All done. Error completing request .. ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate

Oh, I just spotted it, the script renames the files after downloading :

Rename the files to use an underscore instead of a minus character ...

so edge-model.pth -> edge_model.pth, and the same for the two others ..

xjerixx commented 1 year ago

Screenshot 2023-04-13 at 12 21 38 am i think you may have solved it! fingers crossed this works, it's looking promising so far :)

thygate commented 1 year ago

It's working or you would not have made it this far.

xjerixx commented 1 year ago

just messaging to confirm that it has worked Screenshot 2023-04-13 at 12 31 28 am

thank you so so much for getting back to me and being kind and patient. I really appreciate you developing this tool and helping make it work on my machine <3

thygate commented 1 year ago

Try one of the zoedepth models, and see where it tries to save them, perhaps we can download them manually too ..

xjerixx commented 1 year ago

just tried it, getting the same SSL issues with my certificates :/

DepthMap v0.3.11
device: cpu
Loading model weights from  zoedepth_n

img_size [512, 512]
Error completing request
Arguments: (0, <PIL.Image.Image image mode=RGB size=1335x748 at 0x3446DC6A0>, None, '', '', 1, 7, 512, 512, False, True, False, False, 0, 1, False, 1, True, True, False, False, ['left-right', 'red-cyan-anaglyph'], 2.5, 'polylines_sharp', 0, True, True, False, False, False, 'u2net', False, 0, 2, False, None, True, False, True, False) {}
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 976, in send
    self.connect()
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1455, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1071, in _create
    self.do_handshake()
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ivan_timofejev/stable-diffusion-webui/modules/call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "/Users/ivan_timofejev/stable-diffusion-webui/modules/call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 1110, in run_generate
    outputs, mesh_fi, meshsimple_fi = run_depthmap(
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 423, in run_depthmap
    model = build_model(conf)
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/dzoedepth/models/builder.py", line 51, in build_model
    return get_version(config.version_name).build_from_config(config)
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/dzoedepth/models/zoedepth/zoedepth_v1.py", line 250, in build_from_config
    return ZoeDepth.build(**config)
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/dzoedepth/models/zoedepth/zoedepth_v1.py", line 240, in build
    core = MidasCore.build(midas_model_type=midas_model_type, use_pretrained_midas=use_pretrained_midas,
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/dzoedepth/models/base_models/midas.py", line 341, in build
    midas = torch.hub.load("intel-isl/MiDaS", midas_model_type,
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/hub.py", line 537, in load
    repo_or_dir = _get_cache_or_reload(repo_or_dir, force_reload, trust_repo, "load",
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/hub.py", line 180, in _get_cache_or_reload
    repo_owner, repo_name, ref = _parse_repo_info(github)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/hub.py", line 133, in _parse_repo_info
    with urlopen(f"https://github.com/{repo_owner}/{repo_name}/tree/main/"):
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)>

Traceback (most recent call last):
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 394, in run_predict
    output = await app.get_blocks().process_api(
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1078, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1012, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/components.py", line 4307, in postprocess
    "name": self.make_temp_copy_if_needed(y),
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/processing_utils.py", line 362, in make_temp_copy_if_needed
    temp_dir = self.hash_file(file_path)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/processing_utils.py", line 334, in hash_file
    with open(file_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: "<div class='error'>URLError: &lt;urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)&gt;</div><div class='performance'><p class='time'>Time taken: <wbr>0.44s</p></div>"
thygate commented 1 year ago

You can download the ZoeDepth models here, I'm just not sure where it will look for them, as they are loaded through torch.hub, not manually like all the others.

https://github.com/isl-org/ZoeDepth/releases/tag/v1.0

xjerixx commented 1 year ago

ahh okay, I'm downloading them now, but yeah also not sure where to place them 😅

thygate commented 1 year ago

Try placing them in

~/.cache/torch/hub/checkpoints/

~ is user home .cache might be hidden

xjerixx commented 1 year ago

i found the folder, but there isn't a checkpoints folder there, should I create one and place them there?

thygate commented 1 year ago

yes

xjerixx commented 1 year ago

Screenshot 2023-04-13 at 12 56 02 am Screenshot 2023-04-13 at 12 56 17 am

I put them in that folder and im still getting the SSL error

Last login: Thu Apr 13 00:18:50 on ttys000
ivan_timofejev@Ivans-Mac-mini ~ % cd stable-diffusion-webui
ivan_timofejev@Ivans-Mac-mini stable-diffusion-webui % ./webui.sh

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on ivan_timofejev user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Python 3.10.11 (main, Apr  7 2023, 07:24:53) [Clang 14.0.0 (clang-1400.0.29.202)]
Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
Installing requirements for Web UI
Installing imageio-ffmpeg requirement for depthmap script
Installing pyqt6 requirement for depthmap script

Launching Web UI with arguments: --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
No module 'xformers'. Proceeding without it.
==============================================================================
You are running torch 1.12.1.
The program is tested to work with torch 1.13.1.
To reinstall the desired version, run with commandline flag --reinstall-torch.
Beware that this will cause a lot of large files to be downloaded, as well as
there are reports of issues with training tab on the latest version.

Use --skip-version-check commandline argument to disable this check.
==============================================================================
Loading weights [c6bbc15e32] from /Users/ivan_timofejev/stable-diffusion-webui/models/Stable-diffusion/sd-v1-5-inpainting.ckpt
Creating model from config: /Users/ivan_timofejev/stable-diffusion-webui/configs/v1-inpainting-inference.yaml
LatentInpaintDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.54 M params.
Applying cross attention optimization (InvokeAI).
Textual inversion embeddings loaded(0): 
Model loaded in 5.3s (load weights from disk: 1.4s, create model: 0.6s, apply weights to model: 1.7s, apply half(): 1.1s, move model to device: 0.6s).

Thanks for being a Gradio user! If you have questions or feedback, please join our Discord server and chat with us: https://discord.gg/feTf9x3ZSB
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 9.3s (import torch: 0.9s, import gradio: 0.6s, import ldm: 0.3s, other imports: 0.6s, load scripts: 1.1s, load SD checkpoint: 5.5s, create ui: 0.2s).

DepthMap v0.3.11
device: cpu
Loading model weights from  zoedepth_k

Overwriting config with config_version kitti
img_size [512, 512]
Error completing request
Arguments: (0, <PIL.Image.Image image mode=RGB size=1335x748 at 0x2942EE590>, None, '', '', 1, 8, 512, 512, False, True, False, False, 0, 1, False, 1, True, True, False, False, ['left-right', 'red-cyan-anaglyph'], 2.5, 'polylines_sharp', 0, True, True, False, False, False, 'u2net', False, 0, 2, False, None, True, False, True, False) {}
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 976, in send
    self.connect()
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1455, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1071, in _create
    self.do_handshake()
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ivan_timofejev/stable-diffusion-webui/modules/call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "/Users/ivan_timofejev/stable-diffusion-webui/modules/call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 1110, in run_generate
    outputs, mesh_fi, meshsimple_fi = run_depthmap(
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/depthmap.py", line 430, in run_depthmap
    model = build_model(conf)
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/dzoedepth/models/builder.py", line 51, in build_model
    return get_version(config.version_name).build_from_config(config)
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/dzoedepth/models/zoedepth/zoedepth_v1.py", line 250, in build_from_config
    return ZoeDepth.build(**config)
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/dzoedepth/models/zoedepth/zoedepth_v1.py", line 240, in build
    core = MidasCore.build(midas_model_type=midas_model_type, use_pretrained_midas=use_pretrained_midas,
  File "/Users/ivan_timofejev/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/dzoedepth/models/base_models/midas.py", line 341, in build
    midas = torch.hub.load("intel-isl/MiDaS", midas_model_type,
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/hub.py", line 537, in load
    repo_or_dir = _get_cache_or_reload(repo_or_dir, force_reload, trust_repo, "load",
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/hub.py", line 180, in _get_cache_or_reload
    repo_owner, repo_name, ref = _parse_repo_info(github)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/hub.py", line 133, in _parse_repo_info
    with urlopen(f"https://github.com/{repo_owner}/{repo_name}/tree/main/"):
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)>

Traceback (most recent call last):
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 394, in run_predict
    output = await app.get_blocks().process_api(
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1078, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1012, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/components.py", line 4307, in postprocess
    "name": self.make_temp_copy_if_needed(y),
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/processing_utils.py", line 362, in make_temp_copy_if_needed
    temp_dir = self.hash_file(file_path)
  File "/Users/ivan_timofejev/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/processing_utils.py", line 334, in hash_file
    with open(file_path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: "<div class='error'>URLError: &lt;urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)&gt;</div><div class='performance'><p class='time'>Time taken: <wbr>0.54s</p></div>"
thygate commented 1 year ago

Well, ~/.cache/torch/hub/checkpoints/ is where it stores them for me ..

You'll have to fix the missing certificates to get the zoedepth models working (downloaded in correct location). Those are the most recent depth models and give best results.

xjerixx commented 1 year ago

I'll try and get that fixed asap, thank you for your help on getting this working on my machine, I've already started putting the mesh into blender and playing about with that :)

Screenshot 2023-04-13 at 1 08 43 am Screenshot 2023-04-13 at 1 09 19 am

thygate commented 1 year ago

Glad you got it working and can focus on the creative side. Have fun!

thygate commented 1 year ago

On linux it also saves the ZoeDepth models to ~/.cache/torch/hub/checkpoints

Maybe try restarting the backend after placing the files there ..

Also since you created the checkpoints folder yourself, check the checkpoints folder permissions and ownership, should be same as its parent.