|
|
@ -25,7 +25,7 @@ import towhee |
|
|
|
|
|
|
|
towhee.glob('./image.jpg') \ |
|
|
|
.image_decode() \ |
|
|
|
.image_captioning.magic(model_name='expansionnet_rf') \ |
|
|
|
.image_captioning.magic(model_name='magic_mscoco') \ |
|
|
|
.show() |
|
|
|
``` |
|
|
|
<img src="./cap.png" alt="result1" style="height:20px;"/> |
|
|
@ -37,11 +37,11 @@ import towhee |
|
|
|
|
|
|
|
towhee.glob['path']('./image.jpg') \ |
|
|
|
.image_decode['path', 'img']() \ |
|
|
|
.image_captioning.magic['img', 'text'](model_name='expansionnet_rf') \ |
|
|
|
.image_captioning.magic['img', 'text'](model_name='magic_mscoco') \ |
|
|
|
.select['img', 'text']() \ |
|
|
|
.show() |
|
|
|
``` |
|
|
|
<img src="./tabular.png" alt="result2" style="height:60px;"/> |
|
|
|
<img src="./tab.png" alt="result2" style="height:60px;"/> |
|
|
|
|
|
|
|
|
|
|
|
<br /> |
|
|
@ -51,7 +51,7 @@ towhee.glob['path']('./image.jpg') \ |
|
|
|
|
|
|
|
Create the operator via the following factory method |
|
|
|
|
|
|
|
***expansionnet_v2(model_name)*** |
|
|
|
***magic(model_name)*** |
|
|
|
|
|
|
|
**Parameters:** |
|
|
|
|
|
|
@ -64,16 +64,14 @@ Create the operator via the following factory method |
|
|
|
|
|
|
|
## Interface |
|
|
|
|
|
|
|
An image-text embedding operator takes a [towhee image](link/to/towhee/image/api/doc) as input and generate the correspoing caption. |
|
|
|
An image captioning operator takes a [towhee image](link/to/towhee/image/api/doc) as input and generate the correspoing caption. |
|
|
|
|
|
|
|
|
|
|
|
**Parameters:** |
|
|
|
|
|
|
|
***data:*** *towhee.types.Image (a sub-class of numpy.ndarray)* |
|
|
|
|
|
|
|
The image to generate embedding. |
|
|
|
|
|
|
|
|
|
|
|
The image to generate caption. |
|
|
|
|
|
|
|
**Returns:** *str* |
|
|
|
|
|
|
|