logo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions

Updated 3 years ago

towhee

Image Crop Implementation with CV2

author: David Wang


Desription

An image crop operator implementation with OpenCV.


Code Example

Load a image from path './dog.jpg'.

Write the pipeline in simplified style:

import towhee

towhee.glob('./dog.jpg') \
  .image_decode.cv2() \
  .show()

Write a same pipeline with explicit inputs/outputs name specifications:

import towhee

towhee.glob['path']('./dog.jpg') \
  .image_decode.cv2['path', 'img']() \
  .select['img']() \
  .show()


Factory Constructor

Create the operator via the following factory method

image_decode.cv2()


Interface

An image decode operator takes an image path as input. It decodes the image back to ndarray.

Parameters:

img: str

​ Image file path.

Returns: towhee.types.Image (a sub-class of numpy.ndarray)

​ The decoded image data as numpy.ndarray.

wxywb 4158b9c77c init repo. 2 Commits
file-icon .gitattributes
1.1 KiB
download-icon
Initial commit 3 years ago
file-icon README.md
1012 B
download-icon
init repo. 3 years ago
file-icon __init__.py
721 B
download-icon
init repo. 3 years ago
file-icon image_crop_cv2.py
1.5 KiB
download-icon
init repo. 3 years ago