Browse Source
update the readme.
Signed-off-by: wxywb <xy.wang@zilliz.com>
main
wxywb
2 years ago
1 changed files with
9 additions and
22 deletions
-
README.md
|
|
@ -15,36 +15,23 @@ The pipeline is used to extract the feature vector of detected faces in images. |
|
|
|
## Code Example |
|
|
|
Load an image from path './test_face.jpg'. |
|
|
|
|
|
|
|
*Write the pipeline in simplified style*: |
|
|
|
|
|
|
|
```python |
|
|
|
import towhee |
|
|
|
towhee.glob('./test_face.jpg') \ |
|
|
|
.image_decode.cv2() \ |
|
|
|
.face_embedding.deepface(model_name = 'DeepFace').to_list() |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
<img src="./image.png" height="200px"/> |
|
|
|
|
|
|
|
*Write a pipeline with explicit inputs/outputs name specifications:* |
|
|
|
from towhee.dc2 import pipe, ops, DataCollection |
|
|
|
|
|
|
|
p = ( |
|
|
|
pipe.input('path') |
|
|
|
.map('path', 'img', ops.image_decode()) |
|
|
|
.map('img', 'vec', ops.face_embedding.deepface(model_name = 'DeepFace'))) |
|
|
|
.output('img', 'vec') |
|
|
|
) |
|
|
|
|
|
|
|
```python |
|
|
|
import towhee |
|
|
|
DataCollection(p('./test_face.jpg')).show() |
|
|
|
|
|
|
|
towhee.glob['path']('./test_face.jpg') \ |
|
|
|
.image_decode.cv2['path', 'img']() \ |
|
|
|
.face_embedding.deepface['img', 'vec'](model_name = 'DeepFace') \ |
|
|
|
.select['img','vec']() \ |
|
|
|
.show() |
|
|
|
``` |
|
|
|
<img src="./image.png" height="200px"/> |
|
|
|
|
|
|
|
<br /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Factory Constructor |
|
|
|
|
|
|
|
Create the operator via the following factory method |
|
|
|