Browse Source
Update
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
v1
3 changed files with
10 additions and
29 deletions
-
README.md
-
BIN
result.png
-
BIN
src_dog.jpg
|
|
@ -2,50 +2,31 @@ |
|
|
|
|
|
|
|
*author: Kaiyuan Hu, Rentong Guo* |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<br /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Description |
|
|
|
|
|
|
|
An image decode operator implementation with OpenCV. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<br /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Code Example |
|
|
|
|
|
|
|
Load a image from path './dog.jpg'. |
|
|
|
Load a image from path './src_dog.jpg'. |
|
|
|
|
|
|
|
*Write the pipeline in simplified style:* |
|
|
|
*Write a pipeline with explicit inputs/outputs name specifications:* |
|
|
|
|
|
|
|
```python |
|
|
|
import towhee |
|
|
|
from towhee.dc2 import pipe, ops, DataCollection |
|
|
|
|
|
|
|
towhee.glob('./dog.jpg') \ |
|
|
|
.image_decode.cv2() \ |
|
|
|
.show() |
|
|
|
p = ( |
|
|
|
pipe.input('path') |
|
|
|
.map('path', 'image', ops.image_decode.cv2_rgb()) |
|
|
|
.output('path', 'image') |
|
|
|
) |
|
|
|
``` |
|
|
|
|
|
|
|
*Write a same pipeline with explicit inputs/outputs name specifications:* |
|
|
|
|
|
|
|
```python |
|
|
|
import towhee |
|
|
|
|
|
|
|
towhee.glob['path']('./dog.jpg') \ |
|
|
|
.image_decode.cv2['path', 'img']() \ |
|
|
|
.select['img']() \ |
|
|
|
.show() |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="./show_result.jpg" height="150px"/> |
|
|
|
<img src="./result.png" height="150px"/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -57,7 +38,7 @@ towhee.glob['path']('./dog.jpg') \ |
|
|
|
|
|
|
|
Create the operator via the following factory method: |
|
|
|
|
|
|
|
***image_decode.cv2()*** |
|
|
|
***image_decode.cv2_rgb()*** |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Width:
|
Height:
|
Size: 58 KiB
|
Width:
|
Height:
|
Size: 26 KiB
|