Skip to content

Commit

Permalink
Add documentation, remove tests and junk
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemellophone committed Jul 9, 2020
1 parent 8aa24a9 commit 501f11e
Show file tree
Hide file tree
Showing 249 changed files with 18,450 additions and 7,297 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,26 @@ jobs:
sudo xcode-select -s /Applications/Xcode_11.5.app/Contents/Developer
xcodebuild -version
- name: macOS - Cache OpenCV dependencies for macOS
id: caching
if: ${{ runner.os == 'macOS' }}
uses: actions/cache@v2
with:
path: |
/opt/opencv
# The key based on the file hash of the build script
# i.e. changing OPENCV_VERSION within the script will invalidate the cache
key: ${{ runner.os }}-build-opencv-${{ hashFiles('scripts/_install_opencv_*_on_macos.sh') }}

- name: macOS - Install MacPorts
if: ${{ runner.os == 'macOS' }}
uses: WildbookOrg/wbia-pypkg-build/actions/[email protected]

- name: Build wheel
env:
CIBW_MANYLINUX_X86_64_IMAGE: wildme/manylinux:opencv-3.4.10
CIBW_SKIP: cp27-* pp27-* pp36-* *-win32 *-win_amd64 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x
CIBW_BEFORE_BUILD_LINUX: bash scripts/ci_prepare_centos_for_build.sh
CIBW_BEFORE_BUILD_MACOS: bash scripts/ci_prepare_macos_for_build.sh
CIBW_TEST_COMMAND: python -c "import pydarknet; from pydarknet.__main__ import main; main()"
run: |
Expand All @@ -54,9 +67,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# This allows the setuptools_scm library to discover the tag version from git
fetch-depth: 0

- uses: actions/setup-python@v2
name: Install Python
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ htmlcov/

# setuptools_scm version discovery writes the version to <pkg>/_version.py
**/_version.py

_docs/_build
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: |
(?x)(
^docs/ |
^_docs/_build/html/
)
repos:
# - repo: https://github.com/psf/black
# rev: stable
Expand Down
30 changes: 21 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if(OS_IS_MACOS)
include_directories(/opt/local/include)
link_directories(/opt/local/lib)

# find_package(Eigen3 3 REQUIRED NO_MODULE)
find_package(Eigen3 3 REQUIRED NO_MODULE)

set(CMAKE_INSTALL_RPATH "/opt/local/lib")

Expand Down Expand Up @@ -111,15 +111,27 @@ set(NVCC_COMPILER_BINDIR
"Directory where nvcc should look for C++ compiler. This is passed to nvcc through the --compiler-bindir option."
)

# find_package(OpenCV REQUIRED) if(OpenCV_FOUND) add_definitions(-DOPENCV)
# include_directories(${OpenCV_INCLUDE_DIR}) else() message(FATAL_ERROR "OpenCV
# NOT found") endif()
if(OS_IS_MACOS)
find_package(Gflags REQUIRED)
if(Gflags_FOUND
OR GFLAGS_FOUND
OR GFLAGS_INCLUDE_DIRS)
message(STATUS "GFLAGS_INCLUDE_DIR: ${GFLAGS_INCLUDE_DIR}")
message(STATUS "GFLAGS_LIBRARIES: ${GFLAGS_LIBRARIES}")
include_directories(${GFLAGS_INCLUDE_DIR})
else()
message(FATAL_ERROR "GFlags NOT found")
endif()
endif()

# if(OS_IS_MACOS) find_package(Gflags REQUIRED) if(Gflags_FOUND OR GFLAGS_FOUND
# OR GFLAGS_INCLUDE_DIRS) message(STATUS "GFLAGS_INCLUDE_DIR:
# ${GFLAGS_INCLUDE_DIR}") message(STATUS "GFLAGS_LIBRARIES:
# ${GFLAGS_LIBRARIES}") include_directories(${GFLAGS_INCLUDE_DIR}) else()
# message(FATAL_ERROR "GFlags NOT found") endif() endif()
find_package(OpenCV 3.4 REQUIRED)
# find_package(OpenCV REQUIRED)
if(OpenCV_FOUND)
add_definitions(-DOPENCV)
include_directories(${OpenCV_INCLUDE_DIRS})
else()
message(FATAL_ERROR "OpenCV NOT found")
endif()

find_package(Threads REQUIRED)
if(Threads_FOUND)
Expand Down
31 changes: 23 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
Random Forest / Hough Voting Detection Algorithm
================================================
=======================
Wildbook IA - PyDarknet
=======================

Unix / Mac compatible distribution based on the Random Forest code developed by Gall et. al.
|Build| |Pypi| |ReadTheDocs|

The code has been parallelized in specific spots using OpenMP to help speed up training
and detection. A Python wrapper has also been created to help with ease of testing.
Python wrapper for Darknet - Part of the WildMe / Wildbook IA Project.

REQUIRED:
Unix / Mac compatible distribution based on the code developed by Redmon et. al.

https://github.com/bluemellophone/detecttools
Repos relevant to the ibeis project:

https://github.com/bluemellophone/IBEIS2014
* https://github.com/WildbookOrg/wildbook-ia

* https://github.com/bluemellophone/IBEIS2014


.. |Build| image:: https://img.shields.io/github/workflow/status/WildbookOrg/wbia-tpl-pydarknet/Build%20and%20upload%20to%20PyPI/master
:target: https://github.com/WildbookOrg/wbia-tpl-pydarknet/actions?query=branch%3Amaster+workflow%3A%22Build+and+upload+to+PyPI%22
:alt: Build and upload to PyPI (master)

.. |Pypi| image:: https://img.shields.io/pypi/v/wbia-pydarknet.svg
:target: https://pypi.python.org/pypi/wbia-pydarknet
:alt: Latest PyPI version

.. |ReadTheDocs| image:: https://readthedocs.org/projects/wbia-tpl-pydarknet/badge/?version=latest
:target: http://wbia-tpl-pydarknet.readthedocs.io/en/latest/
:alt: Documentation on ReadTheDocs
19 changes: 19 additions & 0 deletions _docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
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)
74 changes: 74 additions & 0 deletions _docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# -*- coding: utf-8 -*-
from sphinx.ext.autodoc import between
import alabaster # NOQA
import sys
import os

sys.path.append(sys.path.insert(0, os.path.abspath('../')))

autosummary_generate = True

modindex_common_prefix = ['_']

master_doc = 'index'

html_theme = 'alabaster'

html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html',
'searchbox.html',
'donate.html',
]
}

# -- Project information -----------------------------------------------------

project = 'wbia-pydarknet'
copyright = '2020, Wild Me'
author = 'Joseph Redmon, Jason Parham'

# The short X.Y version
version = '3.0.1'

# The full version, including alpha/beta/rc tags
release = '3.0.1'


# -- General configuration ---------------------------------------------------

MOCK_MODULES = []
if len(MOCK_MODULES) > 0:
import mock

for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock()

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
# For LaTeX
'sphinx.ext.imgmath',
# For Google Sytle Docstrs
# https://pypi.python.org/pypi/sphinxcontrib-napoleon
'sphinx.ext.napoleon',
'alabaster',
]


# -- Extension configuration -------------------------------------------------

# -- Options for todo extension ----------------------------------------------

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True


def setup(app):
# Register a sphinx.ext.autodoc.between listener to ignore everything
# between lines that contain the word IGNORE
app.connect('autodoc-process-docstring', between('^.*IGNORE.*$', exclude=True))
return app
21 changes: 21 additions & 0 deletions _docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. pydarknet documentation master file, created by
sphinx-quickstart on Thu Jul 9 13:26:36 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to pydarknet's documentation!
=====================================

.. toctree::
:maxdepth: 8
:caption: Contents:

pydarknet


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions _docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%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.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd
54 changes: 54 additions & 0 deletions _docs/pydarknet.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
pydarknet package
=================

Submodules
----------

pydarknet.\_\_main\_\_ module
-----------------------------

.. automodule:: pydarknet.__main__
:members:
:undoc-members:
:show-inheritance:

pydarknet.\_pydarknet module
----------------------------

.. automodule:: pydarknet._pydarknet
:members:
:undoc-members:
:show-inheritance:

pydarknet.\_version module
--------------------------

.. automodule:: pydarknet._version
:members:
:undoc-members:
:show-inheritance:

pydarknet.ctypes\_interface module
----------------------------------

.. automodule:: pydarknet.ctypes_interface
:members:
:undoc-members:
:show-inheritance:

pydarknet.pydarknet\_helpers module
-----------------------------------

.. automodule:: pydarknet.pydarknet_helpers
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: pydarknet
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit 501f11e

Please sign in to comment.