Skip to content

Commit cc26b97

Browse files
committed
Update docs
1 parent 4c8b3be commit cc26b97

File tree

7 files changed

+106
-66
lines changed

7 files changed

+106
-66
lines changed

.readthedocs.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.12"
7+
8+
sphinx:
9+
configuration: docs/conf.py
10+
11+
python:
12+
install:
13+
- method: pip
14+
path: .
15+
extra_requirements:
16+
- docs

docs/api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
API Reference
2+
============
3+
4+
.. automodule:: bbox_visualizer.bbox_visualizer
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/conf.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,14 @@
3131

3232
# Add any Sphinx extension module names here, as strings. They can be
3333
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
34-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'recommonmark', 'sphinx.ext.autosectionlabel', 'sphinx.ext.napoleon']
34+
extensions = [
35+
'sphinx.ext.autodoc',
36+
'sphinx.ext.napoleon',
37+
'sphinx.ext.viewcode',
38+
'sphinx.ext.githubpages',
39+
'sphinx_autodoc_typehints',
40+
'myst_parser',
41+
]
3542

3643
# Add any paths that contain templates here, relative to this directory.
3744
templates_path = ['_templates']
@@ -47,8 +54,8 @@
4754

4855
# General information about the project.
4956
project = 'bbox-visualizer'
50-
copyright = "2020, Shoumik Sharar Chowdhury"
51-
author = "Shoumik Sharar Chowdhury"
57+
copyright = '2024, Shoumik Sharar Chowdhury'
58+
author = 'Shoumik Sharar Chowdhury'
5259

5360
# The version info for the project you're documenting, acts as replacement
5461
# for |version| and |release|, also used in various other places throughout
@@ -64,7 +71,7 @@
6471
#
6572
# This is also used if you do content translation via gettext catalogs.
6673
# Usually you set "language" from the command line for these cases.
67-
language = None
74+
language = 'en'
6875

6976
# List of patterns, relative to source directory, that match files and
7077
# directories to ignore when looking for source files.
@@ -94,7 +101,7 @@
94101
# Add any paths that contain custom static files (such as style sheets) here,
95102
# relative to this directory. They are copied after the builtin static files,
96103
# so a file named "default.css" will overwrite the builtin "default.css".
97-
# html_static_path = ['_static']
104+
html_static_path = ['_static']
98105

99106
#
100107
autosectionlabel_prefix_document = True
@@ -161,5 +168,14 @@
161168
'Miscellaneous'),
162169
]
163170

171+
# Auto-generate API documentation
172+
autodoc_default_options = {
173+
'members': True,
174+
'member-order': 'bysource',
175+
'special-members': '__init__',
176+
'undoc-members': True,
177+
'exclude-members': '__weakref__'
178+
}
179+
164180

165181

docs/index.rst

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,19 @@
1-
bbox-visualizer:
2-
================
3-
.. role:: python(code)
4-
:language: python
5-
6-
bbox-visualizer helps you easily draw bounding boxes with their corresponding labels after detecting them using any object detection method. The bounding boxes are expected to be in the format :python:`(xmin, ymin, xmax, ymax)`.
1+
Welcome to bbox-visualizer's documentation!
2+
=====================================
73

4+
bbox-visualizer is a Python package that provides different ways to visualize objects given bounding box data.
85

96
.. toctree::
107
:maxdepth: 2
118
:caption: Contents:
129

10+
readme
1311
installation
14-
15-
Usage
16-
-----
17-
.. code-block:: python
18-
19-
import bbox_visualizer as bbv
20-
21-
.. automodule:: bbox_visualizer.bbox_visualizer
22-
:members:
23-
24-
25-
Project Info
26-
------------
27-
28-
.. toctree::
29-
:maxdepth: 2
30-
31-
../CONTRIBUTING
32-
../HISTORY
33-
../AUTHORS
12+
usage
13+
api
14+
contributing
15+
authors
16+
history
3417

3518
Indices and tables
3619
==================

docs/installation.rst

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,10 @@
44
Installation
55
============
66

7-
Requirements
8-
-----------
9-
10-
* Python >= 3.8
11-
* opencv-python >= 4.1.0.25
12-
* numpy >= 1.19.0
13-
14-
bbox-visualizer officially supports Python 3.8, 3.9, 3.10, 3.11, and 3.12.
15-
167
Recommended Installation (using uv)
178
--------------------------------
189

19-
`uv` is a extremely fast Python package installer and resolver. To install bbox-visualizer using uv:
10+
`uv` is an extremely fast Python package installer and resolver. To install bbox-visualizer using uv:
2011

2112
1. First, install uv if you haven't already:
2213

@@ -39,49 +30,34 @@ You can also install bbox-visualizer using pip:
3930
4031
$ pip install bbox-visualizer
4132
42-
If you don't have `pip`_ installed, this `Python installation guide`_ can guide
43-
you through the process.
44-
45-
.. _pip: https://pip.pypa.io
46-
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
47-
48-
49-
From sources
50-
------------
33+
From Source
34+
----------
5135

52-
The sources for bbox_visualizer can be downloaded from the `Github repo`_.
36+
The source for bbox-visualizer can be downloaded from the `Github repo`_.
5337

54-
You can either clone the public repository:
38+
You can clone the public repository:
5539

5640
.. code-block:: console
5741
5842
$ git clone git://github.com/shoumikchow/bbox-visualizer
5943
60-
Or download the `tarball`_:
44+
Once you have a copy of the source, you can install it with uv (recommended):
6145

6246
.. code-block:: console
6347
64-
$ curl -OJL https://github.com/shoumikchow/bbox-visualizer/tarball/master
65-
66-
Once you have a copy of the source, you can install it using uv (recommended):
67-
68-
.. code-block:: console
69-
70-
$ uv pip install .
48+
$ uv pip install -e .
7149
7250
For development installation with all extra dependencies:
7351

7452
.. code-block:: console
7553
76-
$ uv pip install ".[dev]"
54+
$ uv pip install -e ".[dev]"
7755
7856
Or using pip:
7957

8058
.. code-block:: console
8159
82-
$ pip install .
83-
$ pip install ".[dev]" # for development installation
84-
60+
$ pip install -e .
61+
$ pip install -e ".[dev]" # for development installation
8562
8663
.. _Github repo: https://github.com/shoumikchow/bbox-visualizer
87-
.. _tarball: https://github.com/shoumikchow/bbox-visualizer/tarball/master

docs/usage.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Usage
2+
=====
3+
4+
To use bbox-visualizer in a project:
5+
6+
.. code-block:: python
7+
8+
import bbox_visualizer as bbv
9+
import cv2
10+
import numpy as np
11+
12+
# Load an image
13+
image = cv2.imread('image.jpg')
14+
15+
# Example bounding box in (xmin, ymin, xmax, ymax) format
16+
bbox = (100, 100, 200, 200)
17+
label = "Object"
18+
19+
# Draw bounding box with label
20+
image_with_box = bbv.draw_rectangle(image, bbox)
21+
image_with_label = bbv.add_label(image_with_box, label, bbox)
22+
23+
# Or use multiple bounding boxes
24+
bboxes = [(100, 100, 200, 200), (300, 300, 400, 400)]
25+
labels = ["Object 1", "Object 2"]
26+
27+
# Draw multiple boxes with labels
28+
for bbox, label in zip(bboxes, labels):
29+
image = bbv.draw_rectangle(image, bbox)
30+
image = bbv.add_label(image, label, bbox)
31+
32+
# Display the result
33+
cv2.imshow('Image with bounding boxes', image)
34+
cv2.waitKey(0)
35+
cv2.destroyAllWindows()

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ dev = [
4141
"pytest-cov>=6.0.0",
4242
"black>=24.1.1",
4343
"ruff>=0.2.1",
44-
"Sphinx>=7.0.0",
44+
]
45+
46+
docs = [
47+
"sphinx>=7.0.0",
48+
"sphinx-rtd-theme>=2.0.0",
49+
"sphinx-autodoc-typehints>=1.24.0",
50+
"myst-parser>=2.0.0",
51+
"docutils>=0.20.1"
4552
]
4653

4754
[project.urls]

0 commit comments

Comments
 (0)