Download app.py from mandala/PA: direct link, hf CLI and curl.
- Browser
- Download file 470 Bytes
-
https://huggingface.co/spaces/mandala/PA/resolve/main/app.py
- Command line
-
hf download hf://spaces/mandala/PA/app.py
-
curl -L -o app.py https://huggingface.co/spaces/mandala/PA/resolve/main/app.py
470 Bytes
| from google.colab.patches import cv2_imshow | |
| import cv2 | |
| img = cv2.imread("Family.JPG") | |
| cv2_imshow(img) | |
| img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
| cv2_imshow(img_gray) | |
| img_invert = cv2.bitwise_not(img_gray) | |
| # cv2_imshow(img_invert) | |
| img_smoothing = cv2.GaussianBlur(img_invert, (21, 21),sigmaX=0, sigmaY=0) | |
| # cv2_imshow(img_smoothing) | |
| def dodgeV2(x, y): | |
| return cv2.divide(x, 255 - y, scale=256) | |
| final_img = dodgeV2(img_gray, img_smoothing) | |
| cv2_imshow(final_img) |