Unverified Commit 8e1d5a03 authored by narugo1992's avatar narugo1992 Committed by GitHub
Browse files

Merge pull request #85 from deepghs/dev/bg

dev(narugo): add background resource
parents c25b9e03 18161f58
Loading
Loading
Loading
Loading
+51 −0
Original line number Diff line number Diff line
imgutils.resource.background
=======================================

.. currentmodule:: imgutils.resource.background

.. automodule:: imgutils.resource.background


BackgroundImageSet
------------------------------------------

.. autoclass:: BackgroundImageSet
    :members: __init__, list_image_files, get_image_file, get_image, random_image_file, random_image



list_bg_image_files
------------------------------------------

.. autofunction:: list_bg_image_files



get_bg_image_file
------------------------------------------

.. autofunction:: get_bg_image_file



get_bg_image
------------------------------------------

.. autofunction:: get_bg_image



random_bg_image_file
------------------------------------------

.. autofunction:: random_bg_image_file



random_bg_image
------------------------------------------

.. autofunction:: random_bg_image


+16 −0
Original line number Diff line number Diff line
import random

from imgutils.resource import list_bg_image_files, get_bg_image
from plot import image_plot

if __name__ == '__main__':
    filenames = random.sample(list_bg_image_files(), 9)

    image_plot(
        *(
            (get_bg_image(filename), filename)
            for filename in filenames
        ),
        columns=3,
        figsize=(14, 10),
    )
+593 −0

File added.

Preview size limit exceeded, changes collapsed.

+14 −0
Original line number Diff line number Diff line
imgutils.resource
=====================

.. currentmodule:: imgutils.resource

.. automodule:: imgutils.resource


.. toctree::
    :maxdepth: 3

    background

+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ configuration file's structure and their versions.
    api_doc/ocr/index
    api_doc/operate/index
    api_doc/pose/index
    api_doc/resource/index
    api_doc/restore/index
    api_doc/sd/index
    api_doc/segment/index
Loading