Skip to content

Commit

Permalink
Merge pull request #85 from deepghs/dev/bg
Browse files Browse the repository at this point in the history
dev(narugo): add background resource
  • Loading branch information
narugo1992 authored May 3, 2024
2 parents c25b9e0 + 18161f5 commit 8e1d5a0
Show file tree
Hide file tree
Showing 12 changed files with 1,118 additions and 1 deletion.
51 changes: 51 additions & 0 deletions docs/source/api_doc/resource/background.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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 changes: 16 additions & 0 deletions docs/source/api_doc/resource/background_full.plot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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 changes: 593 additions & 0 deletions docs/source/api_doc/resource/background_full.plot.py.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions docs/source/api_doc/resource/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
imgutils.resource
=====================

.. currentmodule:: imgutils.resource

.. automodule:: imgutils.resource


.. toctree::
:maxdepth: 3

background


1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions imgutils/resource/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
Overview:
Quickly get some basic resources. E.g. high quality background images.
"""
from .background import *
Loading

0 comments on commit 8e1d5a0

Please sign in to comment.