Commit fff68719 authored by narugo1992's avatar narugo1992
Browse files

dev(narugo): try fix this unittest

parent 57b797a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ unittest:
		--cov="${RANGE_SRC_DIR}" \
		$(if ${MIN_COVERAGE},--cov-fail-under=${MIN_COVERAGE},) \
		$(if ${WORKERS},-n ${WORKERS},) \
		--reruns 8 --reruns-delay 2 --only-rerun '(OSError|Timeout|HTTPError.*429|HTTPError.*502|HTTPError.*504|check your connection|429 error)'
		--reruns 8 --reruns-delay 2 --only-rerun '(OSError|Timeout|HTTPError.*429|HTTPError.*502|HTTPError.*504|check your connection|429 error|CAS service error)'

docs:
	$(MAKE) -C "${DOC_DIR}" build
+16 −5
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ def get_pixai_tags(image: ImageTyping, model_name: str = 'v0.9',

    :param image: The input image to analyze (file path, PIL Image, numpy array, etc.)
    :type image: ImageTyping
    :param model_name: Name or path of the PixAI tagger model to use
    :param model_name: Name or repository ID of the PixAI tagger model to use
    :type model_name: str
    :param thresholds: Confidence threshold values. Can be a single float applied to all
                      categories, or a dictionary mapping category IDs/names to specific thresholds
@@ -253,6 +253,17 @@ def get_pixai_tags(image: ImageTyping, model_name: str = 'v0.9',
        Default category thresholds are used if not specified. These vary by model and category
        but typically range from 0.35 to 0.5.

        You can extract embedding of the given image with the following code

        >>> from imgutils.tagging import get_pixai_tags
        >>>
        >>> embedding = get_pixai_tags('skadi.jpg', fmt='embedding')
        >>> 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::
        >>> from imgutils.tagging.pixai import get_pixai_tags
        >>>
@@ -322,8 +333,8 @@ def get_pixai_tags(image: ImageTyping, model_name: str = 'v0.9',
        tags.update(cate_tags)

    values['tag'] = tags
    ips_mapping, ips_counts = {}, defaultdict(lambda: 0)
    if 'ips' in df_tags.columns:
        ips_mapping, ips_counts = {}, defaultdict(lambda: 0)
        for tag, _ in tags.items():
            if tag in d_ips:
                ips_mapping[tag] = d_ips[tag]