Skip to content

Commit

Permalink
Adapting code for package publication
Browse files Browse the repository at this point in the history
  • Loading branch information
nhorro committed Jun 20, 2021
1 parent 823ee15 commit 1282e1a
Show file tree
Hide file tree
Showing 7 changed files with 493 additions and 1 deletion.
68 changes: 67 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,68 @@
# videoanalytics
Python library for prototyping video analytics applications using pipelines and blackboard pattern. Relies on OpenCV, Scipy an other standard CV/ML/DL packages.

Python library for prototyping of video analytic applications. Relies on OpenCV, Keras, and other standard AI python packages.

References:
- Code for YOLOv4 and DeepSORT was adapted from [yolov4-deepsort](https://github.com/theAIGuysCode/yolov4-deepsort).

## Instructions for developers

Import conda environment:

~~~bash
conda env create -f videoanalytics-gpu.yml
~~~

Some examples are provided as jupyter notebooks.

~~~bash
conda activate videoanalytics-gpu.yml
jupyter notebook .
~~~

## Component reference

Components are organized as Sources and sinks which are instanced and connected at execution time as pipelines.
Sources consume data from a camera or file and trigger the processing pipeline.
Sinks process data that was made available from other components and generate new.

- Sources
- VideoReader
- Sinks
- Object detection
- YOLOv4Detector
- DetectorCSV
- Visualization
- Bounding box annotation
- Matplotlib
- Outputs
- Metadata
- DetectionsCSVWriter
- Store object detections as CSV.
- TrackingCSVWriter
- Store tracked objects as CSV.
- Database
- InfluxDB.
- ELasticSearch
- Video
- Write frames to video file.

## Notes for development and dependency management

Exporting conda environment:

~~~bash
conda env export --name videoanalytics-gpu > videoanalytics-gpu.yml
~~~

Exporting requirements for pip package:

~~~bash
pip freeze > requirements.txt
~~~

## Generate documentation (Sphinx)

~~~bash
make
~~~
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
218 changes: 218 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
absl-py==0.12.0
actionlib==1.12.0
angles==1.9.12
argon2-cffi @ file:///tmp/build/80754af9/argon2-cffi_1613036642480/work
astunparse==1.6.3
async-generator==1.10
attrs @ file:///tmp/build/80754af9/attrs_1604765588209/work
backcall @ file:///home/ktietz/src/ci/backcall_1611930011877/work
bleach @ file:///tmp/build/80754af9/bleach_1612211392645/work
bondpy==1.8.3
cachetools==4.2.1
camera-calibration==1.14.0
camera-calibration-parsers==1.11.13
catkin==0.7.20
certifi==2021.5.30
cffi==1.14.0
chardet==4.0.0
cmd2==2.1.1
colorama==0.4.4
controller-manager==0.18.0
controller-manager-msgs==0.18.0
cv-bridge==1.13.0
cycler==0.10.0
decorator @ file:///tmp/build/80754af9/decorator_1617916966915/work
defusedxml @ file:///tmp/build/80754af9/defusedxml_1615228127516/work
diagnostic-analysis==1.9.3
diagnostic-common-diagnostics==1.9.3
diagnostic-updater==1.9.3
dynamic-reconfigure==1.6.3
easydict==1.9
entrypoints==0.3
gast==0.3.3
gazebo-plugins==2.8.6
gazebo-ros==2.8.6
gencpp==0.6.2
geneus==2.2.6
genlisp==0.4.16
genmsg==0.5.12
gennodejs==2.0.1
genpy==0.6.9
google-auth==1.28.1
google-auth-oauthlib==0.4.4
google-pasta==0.2.0
grpcio==1.37.0
h5py==2.10.0
idna==2.10
image-geometry==1.13.0
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1617877314848/work
interactive-markers==1.11.5
ipykernel @ file:///tmp/build/80754af9/ipykernel_1596206598566/work/dist/ipykernel-5.3.4-py3-none-any.whl
ipython @ file:///tmp/build/80754af9/ipython_1617118429768/work
ipython-genutils @ file:///tmp/build/80754af9/ipython_genutils_1606773439826/work
ipywidgets @ file:///tmp/build/80754af9/ipywidgets_1610481889018/work
jedi==0.17.0
Jinja2 @ file:///tmp/build/80754af9/jinja2_1612213139570/work
joint-state-publisher==1.12.15
jsonschema @ file:///tmp/build/80754af9/jsonschema_1602607155483/work
jupyter==1.0.0
jupyter-client @ file:///tmp/build/80754af9/jupyter_client_1616770841739/work
jupyter-console @ file:///tmp/build/80754af9/jupyter_console_1616615302928/work
jupyter-core @ file:///tmp/build/80754af9/jupyter_core_1612213308260/work
jupyterlab-pygments @ file:///tmp/build/80754af9/jupyterlab_pygments_1601490720602/work
jupyterlab-widgets @ file:///tmp/build/80754af9/jupyterlab_widgets_1609884341231/work
kdl-parser-py==1.13.1
Keras-Preprocessing==1.1.2
kiwisolver @ file:///tmp/build/80754af9/kiwisolver_1612282414123/work
laser-geometry==1.6.5
lxml==4.6.3
Markdown==3.3.4
MarkupSafe @ file:///tmp/build/80754af9/markupsafe_1594371495811/work
matplotlib @ file:///tmp/build/80754af9/matplotlib-suite_1613407855456/work
message-filters==1.14.5
mistune @ file:///tmp/build/80754af9/mistune_1594373098390/work
mkl-fft==1.3.0
mkl-random==1.1.1
mkl-service==2.3.0
Mypackage==0.1
nbclient @ file:///tmp/build/80754af9/nbclient_1614364831625/work
nbconvert @ file:///tmp/build/80754af9/nbconvert_1601914821128/work
nbformat @ file:///tmp/build/80754af9/nbformat_1617383369282/work
nest-asyncio @ file:///tmp/build/80754af9/nest-asyncio_1613680548246/work
networkx==2.2
notebook @ file:///tmp/build/80754af9/notebook_1616443455024/work
numpy==1.18.5
oauthlib==3.1.0
olefile==0.46
opencv-python==4.1.1.26
opt-einsum==3.3.0
packaging @ file:///tmp/build/80754af9/packaging_1611952188834/work
pandas==1.2.4
pandocfilters @ file:///tmp/build/80754af9/pandocfilters_1605120451932/work
parso @ file:///tmp/build/80754af9/parso_1617223946239/work
pexpect @ file:///tmp/build/80754af9/pexpect_1605563209008/work
pickleshare @ file:///tmp/build/80754af9/pickleshare_1606932040724/work
Pillow @ file:///tmp/build/80754af9/pillow_1617386154241/work
prometheus-client @ file:///tmp/build/80754af9/prometheus_client_1618088486455/work
prompt-toolkit @ file:///tmp/build/80754af9/prompt-toolkit_1616415428029/work
protobuf==3.15.8
ptyprocess @ file:///tmp/build/80754af9/ptyprocess_1609355006118/work/dist/ptyprocess-0.7.0-py2.py3-none-any.whl
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser @ file:///tmp/build/80754af9/pycparser_1594388511720/work
Pygments @ file:///tmp/build/80754af9/pygments_1615143339740/work
pyparsing @ file:///home/linux1/recipes/ci/pyparsing_1610983426697/work
pyperclip==1.8.2
pyrsistent @ file:///tmp/build/80754af9/pyrsistent_1600141707582/work
python-dateutil @ file:///home/ktietz/src/ci/python-dateutil_1611928101742/work
python-qt-binding==0.4.0
pytz @ file:///tmp/build/80754af9/pytz_1612215392582/work
pyzmq==20.0.0
qt-dotgraph==0.4.0
qt-gui==0.4.0
qt-gui-cpp==0.4.0
qt-gui-py-common==0.4.0
qtconsole @ file:///tmp/build/80754af9/qtconsole_1616775094278/work
QtPy==1.9.0
requests==2.25.1
requests-oauthlib==1.3.0
resource-retriever==1.12.6
rosapi==0.11.5
rosbag==1.14.5
rosboost-cfg==1.14.8
rosbridge-library==0.11.5
rosbridge-server==0.11.5
rosclean==1.14.7
roscreate==1.14.8
rosgraph==1.14.3
roslaunch==1.14.3
roslib==1.14.7
roslint==0.11.2
roslz4==1.14.5
rosmake==1.14.8
rosmaster==1.14.3
rosmsg==1.14.5
rosnode==1.14.5
rosparam==1.14.3
rospy==1.14.3
rosserial-arduino==0.8.0
rosserial-client==0.8.0
rosserial-python==0.8.0
rosservice==1.14.5
rostest==1.14.5
rostopic==1.14.5
rosunit==1.14.7
roswtf==1.14.5
rqt-action==0.4.9
rqt-bag==0.4.12
rqt-bag-plugins==0.4.12
rqt-console==0.4.9
rqt-dep==0.4.9
rqt-graph==0.4.11
rqt-ground-robot-teleop==1.3.1
rqt-gui==0.5.1
rqt-gui-py==0.5.1
rqt-image-view==0.4.14
rqt-launch==0.4.8
rqt-logger-level==0.4.8
rqt-moveit==0.5.7
rqt-msg==0.4.8
rqt-multiplot==0.0.10
rqt-nav-view==0.5.7
rqt-plot==0.4.9
rqt-pose-view==0.5.8
rqt-publisher==0.4.8
rqt-py-common==0.5.1
rqt-py-console==0.4.8
rqt-reconfigure==0.5.1
rqt-robot-dashboard==0.5.7
rqt-robot-monitor==0.5.9
rqt-robot-steering==0.5.10
rqt-runtime-monitor==0.5.7
rqt-rviz==0.6.0
rqt-service-caller==0.4.8
rqt-shell==0.4.9
rqt-srv==0.4.8
rqt-tf-tree==0.6.0
rqt-top==0.4.8
rqt-topic==0.4.11
rqt-web==0.4.8
rsa==4.7.2
rviz==1.13.9
scipy==1.4.1
Send2Trash @ file:///tmp/build/80754af9/send2trash_1607525499227/work
sensor-msgs==1.12.7
six @ file:///tmp/build/80754af9/six_1605205313296/work
smach==2.0.1
smach-ros==2.0.1
smclib==1.8.3
tensorboard==2.2.2
tensorboard-plugin-wit==1.8.0
tensorflow-gpu==2.3.0rc0
termcolor==1.1.0
terminado==0.9.4
testpath @ file:///home/ktietz/src/ci/testpath_1611930608132/work
tf==1.12.1
tf-conversions==1.12.1
tf-estimator-nightly==2.3.0.dev2020062301
tf2-geometry-msgs==0.6.5
tf2-kdl==0.6.5
tf2-py==0.6.5
tf2-ros==0.6.5
topic-tools==1.14.5
tornado @ file:///tmp/build/80754af9/tornado_1606942283357/work
tqdm==4.60.0
traitlets @ file:///home/ktietz/src/ci/traitlets_1611929699868/work
turtlebot3-automatic-parking==1.1.0
turtlebot3-autorace-core==1.2.0
turtlebot3-teleop==1.2.2
typing-extensions @ file:///home/ktietz/src/ci_mi/typing_extensions_1612808209620/work
urdfdom-py==0.4.3
urllib3==1.26.4
wcwidth @ file:///tmp/build/80754af9/wcwidth_1593447189090/work
webencodings==0.5.1
Werkzeug==1.0.1
widgetsnbextension==3.5.1
wrapt==1.12.1
xacro==1.13.5
zipp @ file:///tmp/build/80754af9/zipp_1615904174917/work
24 changes: 24 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[metadata]
name = videoanalytics
version = 0.0.1
author = Nicolás Eduardo Horro
author_email = [email protected]
description = Library for prototyping video analytic applicatios.
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/nhorro/videoanalytics
project_urls =
Bug Tracker = https://github.com/nhorro/videoanalytics/issues
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: MIT License
Operating System :: OS Independent

[options]
package_dir =
= src
packages = find:
python_requires = >=3.6

[options.packages.find]
where = src
Empty file added src/videoanalytics/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions src/videoanalytics/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def add_one(number):
return number + 1
Loading

0 comments on commit 1282e1a

Please sign in to comment.