Commit 45872eb3 authored by narugo1992's avatar narugo1992
Browse files

dev(narugo): add docs for new detection methods

parent db34832a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -33,7 +33,12 @@ def image_plot(*images, save_as: str, columns=2, keep_axis: bool = False, figsiz
    for i, img in enumerate(images, start=0):
        xi, yi = i // columns, i % columns
        image, label = _image_input_process(img)
        ax = axs[yi] if rows == 1 else axs[xi, yi]
        if rows == 1 and columns == 1:
            ax = axs
        elif rows == 1:
            ax = axs[yi]
        else:
            ax = axs[xi, yi]
        ax.imshow(image)
        ax.set_title(label)
        if not keep_axis:
+14 −0
Original line number Diff line number Diff line
imgutils.detect.face
==========================

.. currentmodule:: imgutils.detect.face

.. automodule:: imgutils.detect.face


detect_faces
------------------------------

.. autofunction:: detect_faces

+19 −0
Original line number Diff line number Diff line
from imgutils.detect import detect_faces
from imgutils.detect.visual import detection_visualize
from plot import image_plot


def _detect(img, **kwargs):
    return detection_visualize(img, detect_faces(img, **kwargs))


if __name__ == '__main__':
    image_plot(
        (_detect('nian.png'), 'large scale'),
        (_detect('two_bikini_girls.png'), 'closed faces'),
        (_detect('genshin_post.jpg'), 'multiple'),
        (_detect('mostima_post.jpg'), 'anime style'),
        save_as='face_detect.dat.svg',
        columns=2,
        figsize=(12, 9),
    )
+311 KiB
Loading image diff...
+15 −0
Original line number Diff line number Diff line
imgutils.detect
=====================

.. currentmodule:: imgutils.detect

.. automodule:: imgutils.detect


.. toctree::
    :maxdepth: 3

    face
    person
    visual
Loading