logo
Browse Source

update the readme.

Signed-off-by: wxywb <xy.wang@zilliz.com>
main
wxywb 2 years ago
parent
commit
2cbd683c0a
  1. 20
      README.md

20
README.md

@ -22,18 +22,20 @@ An image crop operator implementation with OpenCV.
Crop the face from 'avengers.jpg'. Crop the face from 'avengers.jpg'.
```python
import towhee
towhee.glob['path']('./avengers.jpg') \
.image_decode['path', 'img']() \
.face_detection.retinaface['img', ('box','score')]()\
.image_crop[('img', 'box'), 'crop'](clamp = True)\
.select['img','crop']()\
.show()
``` ```
from towhee.dc2 import pipe, ops, DataCollection
p = (
pipe.input('path')
.map('path', 'img', ops.image_decode())
.map('img', ('box','score'), ops.face_detection.retinaface())
.map(('img', 'box'), 'crop', ops.image_crop(clamp = True))
.output('img', 'crop')
)
DataCollection(p('./avengers.jpg')).show()
```
<img src="./result2.png" height="150px"/> <img src="./result2.png" height="150px"/>

Loading…
Cancel
Save