Comments (6)
Can I see the full stack trace?
from imaginairy.
For Face Enhancement, I figured out that the detection_Resnet50_Final.pth and parsing_parsenet.pth weight files were not showing in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/facexlib/weights/. Downloading them manually and moving them there solved the issue for the --fix-faces option. However I could find figure out the issue for Automated Replacement.
Here is the full stack trace when running the command: imagine "a couple smiling" --fix-faces
🤖🧠 imaginAIry received 1 prompt(s) and will repeat them 1 times to create 1 images.
Loading model onto mps:0 backend...
Generating 🖼 : "a couple smiling" 512x512px seed:573948737 prompt-strength:7.5 steps:40 sampler-type:plms
PLMS Sampler: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 40/40 [01:17<00:00, 1.93s/it]
Fixing 😊 's in 🖼 using CodeFormer...
Downloading: "https://github.com/xinntao/facexlib/releases/download/v0.1.0/detection_Resnet50_Final.pth" to /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/facexlib/weights/detection_Resnet50_Final.pthTraceback (most recent call last):
File "/Library/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 "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1282, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1328, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1277, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1037, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 975, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1454, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1071, in _create
self.do_handshake()
File "/Library/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:997)During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/bin/imagine", line 8, in
sys.exit(imagine_cmd())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/imaginairy/cmds.py", line 207, in imagine_cmd
imagine_image_files(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/imaginairy/api.py", line 132, in imagine_image_files
for result in imagine(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/imaginairy/api.py", line 334, in imagine
img = enhance_faces(img, fidelity=0.2)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/imaginairy/enhancers/face_restoration_codeformer.py", line 37, in enhance_faces
face_helper = FaceRestoreHelper(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/facexlib/utils/face_restoration_helper.py", line 99, in init
self.face_det = init_detection_model(det_model, half=False, device=self.device, model_rootpath=model_rootpath)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/facexlib/detection/init.py", line 18, in init_detection_model
model_path = load_file_from_url(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/facexlib/utils/misc.py", line 77, in load_file_from_url
download_url_to_file(url, cached_file, hash_prefix=None, progress=progress)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/torch/hub.py", line 593, in download_url_to_file
u = urlopen(req)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open
response = self._open(req, data)
File "/Library/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 "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
result = func(*args)
File "/Library/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 "/Library/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:997)>
Here is the full stack trace when running the command: imagine --init-image pearl000.jpg --mask-prompt face --mask-mode keep --init-image-strength .4 "a female doctor"
🤖🧠 imaginAIry received 1 prompt(s) and will repeat them 1 times to create 1 images.
Sampler type switched to ddim for img2img
Loading model onto mps:0 backend...
Generating 🖼 : "a female doctor" 512x512px seed:855732311 prompt-strength:7.5 steps:40 sampler-type:ddim
Loaded input 🖼 of size (384, 512) from pearl000.jpg
Traceback (most recent call last):
File "/Library/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 "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1282, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1328, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1277, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1037, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 975, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1454, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1071, in _create
self.do_handshake()
File "/Library/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:997)During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/bin/imagine", line 8, in
sys.exit(imagine_cmd())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/imaginairy/cmds.py", line 207, in imagine_cmd
imagine_image_files(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/imaginairy/api.py", line 132, in imagine_image_files
for result in imagine(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/imaginairy/api.py", line 232, in imagine
mask_image = get_img_mask(init_image, prompt.mask_prompt)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/imaginairy/enhancers/clip_masking.py", line 31, in get_img_mask
return get_img_masks(img, descriptions, combine=True)[0]
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/imaginairy/enhancers/clip_masking.py", line 49, in get_img_masks
preds = clip_mask_model()(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/imaginairy/enhancers/clip_masking.py", line 16, in clip_mask_model
model = CLIPDensePredT(version="ViT-B/16", reduce_dim=64)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/imaginairy/vendored/clipseg/init.py", line 428, in init
super().init(version, reduce_cond, reduce_dim, prompt, n_tokens)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/imaginairy/vendored/clipseg/init.py", line 148, in init
self.clip_model, _ = clip.load(version, device="cpu", jit=False)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/imaginairy/vendored/clip/clip.py", line 147, in load
model_path = _download(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/imaginairy/vendored/clip/clip.py", line 65, in _download
with urllib.request.urlopen(url) as source, open(download_target, "wb") as output:
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open
response = self._open(req, data)
File "/Library/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 "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
result = func(*args)
File "/Library/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 "/Library/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:997)>
from imaginairy.
This seems unrelated to the imaginairy library. https://stackoverflow.com/questions/70977935/why-do-i-receive-unable-to-get-local-issuer-certificate-ssl-c997
if you just write a python script that does this, does it work or have the same error?
requests.get("https://github.com/xinntao/facexlib/releases/download/v0.1.0/detection_Resnet50_Final.pth")
from imaginairy.
No error produced when running the command: requests.get("https://github.com/xinntao/facexlib/releases/download/v0.1.0/detection_Resnet50_Final.pth")
from imaginairy.
okay 🤷♂️ well I don't know then. let me know if you figure it out.
As I believe this is an issue with your environment, I'm closing the issue for now. Happy to reopen if we learn more about the problem.
from imaginairy.
Thanks a lot! Seems to be an issue specific to the Python installation on newest macOS. I followed the macOS solution from the stackoverflow link you provided above: went to the Applications/Python 3.10 folder and clicked on the "install certificate.command" to fix the CERTIFICATE_VERIFY_FAILED issue. Then no more issue with the imagine options to perform automated replacement or face enhancement.
from imaginairy.
Related Issues (20)
- Errors in Windows/Conda (beta install) HOT 3
- Erros in Python3.10 Venv Environment HOT 3
- using RAM instead of vram HOT 3
- keyboard interrupt prevents "eject" from happening. model left in unusable state
- OpenDalle HOT 11
- something is corrupting weights HOT 1
- Controlnet/ Masks for SDXL HOT 3
- RuntimeError: mat1 and mat2 must have the same dtype, but got Float and Half HOT 4
- Text Diffusers HOT 1
- Video generation quality issues HOT 2
- Error: No such command 'videogen'. HOT 5
- In china: requests.exceptions.ConnectionError HOT 3
- windows github action smoketests aren't actually doing anything
- Problem with masking
- Multi GPU
- Folder upscale with aimg? HOT 2
- control mode details HOT 1
- The size of tensor a (145) must match the size of tensor b (150) at non-singleton dimension 3 HOT 1
- Remodeling ideas, space detection HOT 1
- Error when specifying size on cpu mode HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imaginairy.