From 555b541cb876b047cfd4a73186651df237a22a30 Mon Sep 17 00:00:00 2001 From: narugo1992 Date: Fri, 8 Nov 2024 18:47:31 +0800 Subject: [PATCH] dev(narugo): update docs --- imgutils/tagging/wd14.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/imgutils/tagging/wd14.py b/imgutils/tagging/wd14.py index 2c4226f133..a7783635fc 100644 --- a/imgutils/tagging/wd14.py +++ b/imgutils/tagging/wd14.py @@ -298,13 +298,23 @@ def get_wd14_tags( - ``embedding``: a 1-dim embedding of image, recommended for index building after L2 normalization - ``prediction``: a 1-dim prediction result of image + You can extract embedding of the given image with the follwing code + + >>> from imgutils.tagging import get_wd14_tags + >>> + >>> embedding = get_wd14_tags('skadi.jpg', fmt='embdding') + >>> embedding.shape + (1024, ) + + This embedding is valuable for constructing indices that enable rapid querying of images based on + visual features within large-scale datasets. + Example: Here are some images for example .. image:: tagging_demo.plot.py.svg :align: center - >>> import os >>> from imgutils.tagging import get_wd14_tags >>> >>> rating, features, chars = get_wd14_tags('skadi.jpg')