Browse Source
Add result png
Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
main
2 changed files with
6 additions and
3 deletions
-
README.md
-
BIN
result.png
|
@ -27,19 +27,22 @@ This operator uses [PyTorch.yolov5](https://pytorch.org/hub/ultralytics_yolov5/) |
|
|
Writing the pipeline in the simplified way |
|
|
Writing the pipeline in the simplified way |
|
|
|
|
|
|
|
|
```Python |
|
|
```Python |
|
|
from towhee.dc2 import pipe, ops |
|
|
|
|
|
|
|
|
from towhee.dc2 import pipe, ops, DataCollection |
|
|
|
|
|
|
|
|
p = ( |
|
|
p = ( |
|
|
pipe.input('url') |
|
|
pipe.input('url') |
|
|
.map('url', 'img', ops.image_decode.cv2_rgb()) |
|
|
.map('url', 'img', ops.image_decode.cv2_rgb()) |
|
|
.flat_map('img', ('boxes', 'class', 'score'), ops.object_detection.yolo()) |
|
|
.flat_map('img', ('boxes', 'class', 'score'), ops.object_detection.yolo()) |
|
|
.output('class', 'score') |
|
|
|
|
|
|
|
|
.flat_map(('img', 'boxes'), 'object', ops.towhee.image_crop()) |
|
|
|
|
|
.output('url', 'object', 'class', 'score') |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
res = p('test.png') |
|
|
res = p('test.png') |
|
|
res.get() |
|
|
|
|
|
|
|
|
DataCollection(res).show() |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
<img src="./result.png" alt="result" height="340px"/> |
|
|
|
|
|
|
|
|
<br /> |
|
|
<br /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Width:
|
Height:
|
Size: 323 KiB
|