Download test/test_sky.py from ethonmax/picpocket: direct link, hf CLI and curl.
- Browser
- Download file 573 Bytes
-
https://huggingface.co/spaces/ethonmax/picpocket/resolve/main/test/test_sky.py
- Command line
-
hf download hf://spaces/ethonmax/picpocket/test/test_sky.py
-
curl -L -o test_sky.py https://huggingface.co/spaces/ethonmax/picpocket/resolve/main/test/test_sky.py
573 Bytes
| import os.path as osp | |
| import cv2 | |
| from modelscope.outputs import OutputKeys | |
| from modelscope.pipelines import pipeline | |
| from modelscope.utils.constant import Tasks | |
| image_skychange = pipeline(Tasks.image_skychange, | |
| model='iic/cv_hrnetocr_skychange') | |
| result = image_skychange( | |
| {'sky_image': '~/Downloads/sky_image.jpg', | |
| 'scene_image': '/opt/data/face/NXEo0zusSaNB2fa232c84898e92ff165e2dfee59cb54.jpg'}) | |
| cv2.imwrite('~/Downloads/result.png', | |
| result[OutputKeys.OUTPUT_IMG]) | |
| print(f'Output written to {osp.abspath("result.png")}') | |