From 787a25b342229e98649466438872af40905fa7e4 Mon Sep 17 00:00:00 2001 From: wxywb Date: Mon, 11 Apr 2022 15:06:52 +0800 Subject: [PATCH] update readme format. Signed-off-by: wxywb --- README.md | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 34307c5..7752c6f 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,18 @@ *author: David Wang* +
-## Desription + + +## Description This operator extracts features for image with [DOLG](https://arxiv.org/abs/2108.02927) which has special design for image retrieval task. It integrates local and global information inside images into compact image representations. This operator is an adaptation from [dongkyuk/DOLG-pytorch](https://github.com/dongkyuk/DOLG-pytorch). + +
+ + ## Code Example Load an image from path './towhee.jpg' to generate an image embedding. @@ -33,11 +40,16 @@ import towhee towhee.glob['path']('./towhee.jpg') \ .image_decode.cv2['path', 'img']() \ .image_embedding.dolg['img', 'vec'](img_size=512, input_dim=3, hidden_dim=1024, output_dim=2048) \ - .select('img', 'vec') \ + .select['img', 'vec']() \ .show() ``` result2 + +
+ + + ## Factory Constructor Create the operator via the following factory method @@ -46,22 +58,27 @@ Create the operator via the following factory method **Parameters:** -​ ***img_size***: *int* +​ ***img_size:*** *int* ​ Scaled input image size to extract embedding. The higher resolution would generate the more discriminateive feature but cost more time to calculate. -​ ***input_dim***: *int* +​ ***input_dim:*** *int* ​ The input dimension of DOLG module (equals pretrained cnn output dimension). -​ ***hidden_dim***: *int* +​ ***hidden_dim:*** *int* ​ The hidden dimension size, local feature branch output dimension. -​ ***output_dim***: *int* +​ ***output_dim:*** *int* ​ The output dimsion size, same as embedding size. + +
+ + + ## Interface An image embedding operator takes a [towhee image](link/to/towhee/image/api/doc) as input. @@ -70,13 +87,13 @@ It uses the pre-trained model specified by model name to generate an image embed **Parameters:** -​ ***img***: *towhee.types.Image (a sub-class of numpy.ndarray)* +​ ***img:*** *towhee.types.Image (a sub-class of numpy.ndarray)* ​ The decoded image data in towhee.types.Image (numpy.ndarray). -**Returns**: *numpy.ndarray* +**Returns:** *numpy.ndarray* ​ The image embedding extracted by model.