diff --git a/.github/workflows/pep8-test.yaml b/.github/workflows/pep8-test.yaml index 7738316..0fbf1df 100644 --- a/.github/workflows/pep8-test.yaml +++ b/.github/workflows/pep8-test.yaml @@ -21,4 +21,4 @@ jobs: pip install flake8 - name: Run PEP8 test run: | - flake8 --max-line-length=130 --exclude=ODRS/train_utils/train_model/models/*,ODRS/ml_utils/*,ODRS/train_utils/custom_train_all.py,ODRS/train_utils/train_model/scripts/yolov7_train.py,tests/* . + flake8 --max-line-length=130 --exclude=ODRS/train_utils/train_model/models/*,ODRS/ml_utils/*,ODRS/train_utils/custom_train_all.py,ODRS/train_utils/train_model/scripts/yolov7_train.py,tests/*,docs/* . diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..b548182 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,18 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.9" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/source/conf.py + +python: + install: + - requirements: docs/requirements.txt diff --git a/ODRS/train_utils/config/custom_config.yaml b/ODRS/train_utils/config/custom_config.yaml index 5bf6837..d7a5752 100755 --- a/ODRS/train_utils/config/custom_config.yaml +++ b/ODRS/train_utils/config/custom_config.yaml @@ -2,7 +2,7 @@ BATCH_SIZE: 10 CLASSES: classes.txt CONFIG_PATH: dataset.yaml DATA_PATH: /home/runner/work/ODRS/ODRS/user_datasets/yolo/aeral -EPOCHS: 10 +EPOCHS: 2 GPU_COUNT: 0 IMG_SIZE: 300 MODEL: yolov5m diff --git a/README.md b/README.md index 9624eed..2e2488d 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # ODRS [![PythonVersion](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue)](https://pypi.org/project/scikit-learn/) + +[![Documentation Status](https://readthedocs.org/projects/odrs-test/badge/?version=latest)](https://odrs-test.readthedocs.io/en/latest/?badge=latest) +

diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..92dd33a --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/__init__.py b/docs/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/docs/img/README.MD b/docs/img/README.MD old mode 100755 new mode 100644 diff --git a/docs/img/alg_scheme.png b/docs/img/alg_scheme.png old mode 100755 new mode 100644 diff --git a/docs/img/model_list.png b/docs/img/model_list.png old mode 100755 new mode 100644 diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..5151b34 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR= source +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..536a004 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,4 @@ +sphinx +sphinx_rtd_theme +autodocsumm + diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html new file mode 100644 index 0000000..f810f01 --- /dev/null +++ b/docs/source/_templates/layout.html @@ -0,0 +1,12 @@ +{% extends "!layout.html" %} + {% block footer %} {{ super() }} + + +{% endblock %} diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..c873ace --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,107 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import datetime +import sys +sys.path.insert(0, os.path.abspath('../..')) +from sphinx.builders.html import StandaloneHTMLBuilder + +# -- Project information ----------------------------------------------------- + +project = 'ODRS' +copyright = '2023, Artem Smetanin, Mikhail Gerasimchuk' +author = 'Artem Smetanin, Mikhail Gerasimchuk' +release = '0.1.0' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx_rtd_theme', + 'sphinx.ext.autodoc', + 'sphinx.ext.coverage', + 'sphinx.ext.napoleon', + 'sphinx.ext.viewcode', + 'sphinx.ext.mathjax', + 'autodocsumm', + 'sphinx.ext.autosummary', + 'sphinx.ext.autodoc.typehints', + 'sphinx.ext.graphviz', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +StandaloneHTMLBuilder.supported_image_types = [ + 'image/svg+xml', + 'image/gif', + 'image/png', + 'image/jpeg' +] +html_theme = "sphinx_rtd_theme" +html_logo = '../img/logo.png' +html_theme_options = { + 'logo_only': True, + 'display_version': False, +} +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +# html_static_path = ['_static'] + +# -- Extension configuration ------------------------------------------------- + +# autodoc_inherit_docstrings = False +# napoleon_google_docstring = True +# napoleon_include_init_with_doc = True +napoleon_google_docstring = True +napoleon_numpy_docstring = False +napoleon_include_init_with_doc = False +napoleon_include_private_with_doc = True +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = True +napoleon_use_admonition_for_notes = True +napoleon_use_admonition_for_references = False +napoleon_use_ivar = True +napoleon_use_keyword = True +napoleon_use_param = True +napoleon_use_rtype = True +napoleon_attr_annotations = False + +autodoc_default_options = { + 'members': True, + 'undoc-members': False, + 'show-inheritance': True, + 'member-order': 'bysource', + 'ignore-module-all': True, +} +autoclass_content = 'class' +autodoc_typehints = 'signature' +autodoc_typehints_format = 'short' +autodoc_mock_imports = ['objgraph', 'memory_profiler', 'gprof2dot', 'snakeviz'] + + diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..0c5ee9b --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,12 @@ +Welcome to ODRS documentation! +============================================ +Content: +======== +.. toctree:: + :maxdepth: 1 + + introduction/index + + + + diff --git a/docs/source/introduction/img_introduction/logo.png b/docs/source/introduction/img_introduction/logo.png new file mode 100644 index 0000000..6c1236f Binary files /dev/null and b/docs/source/introduction/img_introduction/logo.png differ diff --git a/docs/source/introduction/index.rst b/docs/source/introduction/index.rst new file mode 100644 index 0000000..59f1a70 --- /dev/null +++ b/docs/source/introduction/index.rst @@ -0,0 +1,18 @@ +Introduction to Framework +========================= + +.. image:: ./img_introduction/logo.png + +.. toctree:: + :maxdepth: 1 + :caption: Content: + + installation + quickstart + architecture + license + +ODRS - it an open source recommendation system for training object detection models. Our system allows you to choose the most profitable existing object recognition models based on user preferences and data. In addition to choosing the architecture of the model, the system will help you start training and configure the environment. +The proposed recommendation system consists of several components that interact to generate recommendations for machine learning pipelines. + + diff --git a/docs/source/introduction/installation.rst b/docs/source/introduction/installation.rst new file mode 100644 index 0000000..09b99e5 --- /dev/null +++ b/docs/source/introduction/installation.rst @@ -0,0 +1,12 @@ +.. _installation: + +How to install +================ +from GitHub +------------------------ + +.. code-block:: console + + git clone https://github.com/saaresearch/ODRS.git + cd ODRS/ + pip install -r requirements.txt diff --git a/docs/source/introduction/license.rst b/docs/source/introduction/license.rst new file mode 100644 index 0000000..e8b7f6c --- /dev/null +++ b/docs/source/introduction/license.rst @@ -0,0 +1,34 @@ +License information +=================== + +.. code-block:: console + + BSD 3-Clause License + + Copyright (c) 2022, Natural Systems Simulation Lab + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/docs/source/introduction/quickstart.rst b/docs/source/introduction/quickstart.rst new file mode 100644 index 0000000..4566b49 --- /dev/null +++ b/docs/source/introduction/quickstart.rst @@ -0,0 +1,18 @@ +Quickstart +========== + +.. code-block:: python + + + from ODRS.ODRS.api.ODRS import ODRS + #init object with parameters + odrs = ODRS(job="object_detection", data_path = 'full_data_path', classes = "classes.txt", + img_size = "512", batch_size = "25", epochs = "300", + model = 'yolov8x6', gpu_count = 1, select_gpu = "0", config_path = "dataset.yaml", + split_train_value = 0.6, split_test_value = 0.35, split_val_value = 0.05) + from ODRS.ODRS.api.ODRS import ODRS + odrs.fit() + + + + diff --git a/requirements.txt b/requirements.txt index ea973e2..84e42f4 100755 --- a/requirements.txt +++ b/requirements.txt @@ -24,9 +24,6 @@ fonttools==4.38.0 gast==0.4.0 gitdb==4.0.10 GitPython==3.1.32 -google-auth==2.16.0 -google-auth-oauthlib==0.4.6 -google-pasta==0.2.0 grpcio==1.51.1 h5py==3.8.0 idna==2.8 @@ -99,9 +96,6 @@ tensorboard==2.11.2 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.1 tensorboardX==2.6 -tensorflow==2.11.1 -tensorflow-estimator==2.11.0 -tensorflow-io-gcs-filesystem==0.31.0 termcolor==2.2.0 thop==0.1.1.post2209072238 threadpoolctl==3.2.0 @@ -122,4 +116,4 @@ Werkzeug==2.2.3 wrapt==1.15.0 zipp==3.13.0 yacs -wget \ No newline at end of file +wget