Spaces:
Paused
Paused
Download utils.py from theoracle/professional_head: direct link, hf CLI and curl.
- Browser
- Download file 233 Bytes
-
https://huggingface.co/spaces/theoracle/professional_head/resolve/main/utils.py
- Command line
-
hf download hf://spaces/theoracle/professional_head/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/theoracle/professional_head/resolve/main/utils.py
233 Bytes
| from PIL import Image | |
| import cv2 | |
| import numpy as np | |
| def pil_to_cv2(pil_img): | |
| return cv2.cvtColor(np.array(pil_img), cv2.COLOR_RGB2BGR) | |
| def cv2_to_pil(cv_img): | |
| return Image.fromarray(cv2.cvtColor(cv_img, cv2.COLOR_BGR2RGB)) | |