add input sample

pull/14/head
menyifang 3 years ago
parent 37112dfce8
commit 2416932f44

@ -36,6 +36,12 @@ Official implementation of DCT-Net for Portrait Stylization.
## Quick Start ## Quick Start
```bash
git clone https://github.com/menyifang/DCT-Net.git
cd DCT-Net
```
### From python SDK ### From python SDK
A quick use with python SDK A quick use with python SDK

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 KiB

@ -1,12 +1,14 @@
import cv2 import cv2
from modelscope.hub.snapshot_download import snapshot_download
from modelscope.pipelines import pipeline from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
img_cartoon = pipeline(Tasks.image_portrait_stylization, 'damo/cv_unet_person-image-cartoon_compound-models') model_dir = snapshot_download('damo/cv_unet_person-image-cartoon_compound-models', cache_dir='.')
img_cartoon = pipeline('image-portrait-stylization') img_cartoon = pipeline('image-portrait-stylization', model=model_dir)
result = img_cartoon('input.png') result = img_cartoon('input.png')
cv2.imwrite('result.png', result['output_img']) cv2.imwrite('result.png', result['output_img'])
print('finished!')

Loading…
Cancel
Save