Skip to content

Commit

Permalink
Initialize v0.0.0 - Hello world!
Browse files Browse the repository at this point in the history
  • Loading branch information
rathaROG committed Apr 9, 2024
0 parents commit f50c9cb
Show file tree
Hide file tree
Showing 11 changed files with 926 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installed pip packages
requirements/installed_packages.txt

# Environments
.env
.venv
.idea
env/
venv/
ENV/
env.bak/
venv.bak/

.DS_Store

# Neural Network weights -----------------------------------------------------------------------------------------------
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include *.md *.in *.TXT LICENSE
exclude *.cmd
recursive-include vsensebox *
recursive-exclude __pycache__ *
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 📥 `vsensebox-data`

* `vsensebox-data` can dynamically create individual data packages of the supported modules for [`VSenseBox`](https://github.com/rathaumons/vsensebox).

* `vsensebox-data` relies on the configurations inside [`setupconfig`](setupconfig) in order to create individual Python wheels.

* Only a few pretrained weight/model files are included in the prebuilt `.whl` [files on GitHub releases](https://github.com/rathaumons/vsensebox-data/releases).

* The pretrained weight/model files are not included in the repo as they are too big (Over 1GB).

## Installation

* `YOLO_Classic` | [License/Repo](https://github.com/AlexeyAB/darknet)
```
pip install https://github.com/rathaumons/vsensebox-data/releases/download/v0.0.0/vsensebox_data_yolocls-0.0.0-py3-none-any.whl
```
* `YOLO_Ultralytics` | [License/Repo](https://github.com/ultralytics)
```
pip install https://github.com/rathaumons/vsensebox-data/releases/download/v0.0.0/vsensebox_data_yoloult-0.0.0-py3-none-any.whl
```
* `DeepSORT` | [License/Repo](https://github.com/deshwalmahesh/yolov7-deepsort-tracking)
```
pip install https://github.com/rathaumons/vsensebox-data/releases/download/v0.0.0/vsensebox_data_deepsort-0.0.0-py3-none-any.whl
```
12 changes: 12 additions & 0 deletions create_whl.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
:: VSenseBox - Python toolbox for visual sensing
:: GNU General Public License v3 or later (GPLv3+)
:: Copyright (C) 2024 UMONS-Numediart

@echo off
setlocal
cd /d %~dp0
set "PYTHONWARNINGS=ignore"
python -m pip install --upgrade pip
pip install wheel build PyYAML
python -m build --wheel --skip-dependency-check --no-isolation
pause
58 changes: 58 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# VSenseBox - Python toolbox for visual sensing
# GNU General Public License v3 or later (GPLv3+)
# Copyright (C) 2024 UMONS-Numediart


from setuptools import setup
from setupconfig.datamng import DataManager


def main():

long_description = open("README.md", encoding="utf-8").read()

dm = DataManager()
pkg_name, version, packages, package_data = dm.get_selected_data()

setup(
name=pkg_name,
version=version,
url="https://github.com/rathaumons/vsensebox-data",
license="GPL-3.0-or-later",
description="Dynamic data packager for the supported detector/tracker of VSenseBox.",
long_description=long_description,
long_description_content_type="text/markdown",
packages=packages,
package_data=package_data,
include_package_data=True,
author="Ratha SIV",
maintainer="rathaROG",
install_requires=None,
python_requires=">=3.9",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Image Recognition",
"Topic :: Software Development",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
],
)

if __name__ == "__main__":
main()
21 changes: 21 additions & 0 deletions setupconfig/data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- # YOLO_Classic
name: YOLO_Classic
version: 0.0.0
pkg_suffix: yolocls
data_paths:
- vsensebox.data.detectors
#
--- # YOLO_Ultralytics
name: YOLO_Ultralytics
version: 0.0.0
pkg_suffix: yoloult
data_paths:
- vsensebox.data.detectors
#
--- # DeepSORT
name: DeepSORT
version: 0.0.0
pkg_suffix: deepsort
data_paths:
- vsensebox.data.trackers
#
70 changes: 70 additions & 0 deletions setupconfig/datamng.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# VSenseBox - Python toolbox for visual sensing
# GNU General Public License v3 or later (GPLv3+)
# Copyright (C) 2024 UMONS-Numediart


import os
import yaml
from yaml.loader import SafeLoader

this_dir = os.path.dirname(__file__).replace(os.sep, '/')
data_yaml = os.path.join(this_dir, "data.yaml")
selector_yaml = os.path.join(this_dir, "selector.yaml")

class DataManager(object):

def __init__(self, data_yaml=data_yaml):
"""Read and load data from :obj:`data_yaml`.
Parameters
----------
data_yaml : str
A YAML file of data.yaml.
"""
with open(data_yaml) as data:
self.raw_data = yaml.load_all(data, Loader=SafeLoader)
self.data_list = []
for raw_d in list(self.raw_data):
self.data_list.append(raw_d)

def get_selected_data(self, selector_yaml=selector_yaml):
"""Get the selected data.
Parameters
----------
selector_yaml : str
A YAML file of selector.yaml.
Returns
-------
str
Package name, parameter :obj:`name` for :func:`setup()`.
str
Version string of the data/package,
parameter :obj:`version` for :func:`setup()`.
list
List of the included directy of the data/package,
parameter :obj:`packages` for :func:`setup()`.
dict
Dictionary of the included file of the data/package,
parameter :obj:`package_data` for :func:`setup()`.
"""

pkg_name = "vsensebox-data-"
version = ""
packages = []
package_data = {}

with open(selector_yaml) as selector:
self.selector_dict = yaml.load(selector, Loader=SafeLoader)

for d in self.data_list:
if d['name'].lower() == self.selector_dict['name'].lower():
pkg_name += d['pkg_suffix']
version = str(d['version'])
packages = d['data_paths']
for p in packages:
package_data.update({p: ["*"]})
break

return pkg_name, version, packages, package_data
2 changes: 2 additions & 0 deletions setupconfig/selector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--- # Select a module by a module name
name: YOLO_Classic
4 changes: 4 additions & 0 deletions vsensebox/data/detectors/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
4 changes: 4 additions & 0 deletions vsensebox/data/trackers/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

0 comments on commit f50c9cb

Please sign in to comment.