Skip to main content

ignutils

PyPI version

A python package of reusable, battle tested common modules, mainly related to image processing. Issues and contributions are welcome.

Install

python3.8 -m venv venv3.8
source venv3.8/bin/activate
pip3 install --upgrade pip
pip3 install -e ignutils/

ignutils :heart_eyes_cat: Computer Vision Package

  • Json Utils: Utils for reading, writing, comparing json files..

  • Transform Utils : transform_crop, transform paste, transform_img, transform_contour, expand_box, etc.

  • Geom Utils : Geometric operations using points, lines eg: euclidean, line_intersection, get_nearest_pt on a curve.

  • Contour Utils : Resizig, rotation, shifting, union, intersection etc of contours.

  • Show Utils : Show image and json, handles user keypress, wrapper for imshow ans matplot.

  • MultiProcess : Base class for multiprocess, inherit and overide do_something function.

  • Gpu Utils : Get gpu memory free, select device for tensorflow and pytorch, etc

  • Mouse Utils : Mouse based ROI selection, contour drawing etc.

  • Keyboard Utils : Keyboard based utils for selected key recognition.

  • Fisheye Utils : Handling fisheye distortion and undistortion, cropping from distorted image.

  • Draw Utils : Drawing text and polygon on image with params autoselcted.

  • Clone Utils : git clone, commit and push using api.

  • Yaml Utils : Read, Write, Custom Format Yaml files.

  • Registration : Wrapper for registration based on keypoint, ECC, superglue, optical flow etc.

To use superglue_register

cd src/ignutils/registration/
git clone https://github.com/magicleap/SuperGluePretrainedNetwork
  • Video Utils : Getting frames from video , with preprocessing and threading options.

  • Cam Utils: Getting frames from camera, setting properties of camera.

  • Config Utils: Class to handle config creation for any module with config_path as input.​

  • File Utils : Funcs for handling files.
    Eg: get files by extension, checksum of file etc.

  • TypeHint Utils : Typehint for common data structures like contour, image, etc for making functions more readable

  • Docker Utils: To handle basic docker functionalitys like bringdown_container, bringup_container etc,.

  • Labelme Utils: Utils for functions like clean up classes, upgrading, writing label json etc., of labelme files.
    Eg: Upgrade all json in a folder: python -m ignutils.labelme_utils -d json_folder

  • SSH Utils: Utils for mounting and unmounting sshfs filesystems

  • Timer Utils: Utils to do tic toc to check time spent

Adding a Module/submodule

To add a module/submodule,

cd src/ignutils/
  • paste your python file/ folder containing python files
  • update the init.py in ignutils
  • if the unittest requires any file to test you can put it samples present in the root folder
  • add the file name that has unittest in pytest.ini
  • update requirements.txt according to yor package

Deploying of Package in PYPi

  • the deployment will happen only when it's merged with the main branch and there's a change in pyproject.toml file
  • this feature is to avoid publishing of package everytime we PR
  • once we make sure everything is workin fine, we can make changes in the pyproject.toml file
  • change the version to reflect changes in the PyPI

''' version = "0.0.7" '''

Docstring formating

To enable automatic docstring formating:

  • Open Extensions in VSCode.
  • search for autoDocstring - Python Docstring Generator and install it.
  • Open File > Preferences > Settings, in search for Auto Docstring and set it to sphinx.
  • Press CTRL + SHIFT + 2 to automatically create a Docstring Generator.

Add as a submodule

git submodule add https://gitlab.ignitarium.in/ign-ai/internal/ignutils ignutils
Edit .gitmodules with relative path,

[submodule "ignutils"]
    path = ignutils
    url = ../ignutils

Removing Submodule

git submodule deinit ignutils
git rm ignutils
git commit-m "Removed submodule"
rm -rf .git/modules/ignutils

Git credential store

To avoid username password multiple times
git config --global user.name "MyName"
git config --global user.email "MyEmail.ignitarium.com"
git config --global user.password "1234321"
git config --global credential.helper store

Contribute

Add in afolder if its a subpackage and update init.py files inside and outide subpackage. Update README too.

Metadata

Release files for ignutils 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for ignutils 0.0.10
File Interpreter ABI Platform Actions
ignutils-0.0.10-py3-none-any.whl Python 3 none any Details for ignutils-0.0.10-py3-none-any.whl

Release files / ignutils-0.0.10-py3-none-any.whl

Download URL ignutils-0.0.10-py3-none-any.whl
Size 85.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db8afc49e795e1743de318b90507d03d1d3c82a811ec68f94e56c9b589fd6e97
BLAKE2b-256 checksum
How to use checksums
b4a290d243f1614bc3c397d44a594dc231f52ccf2befc3bdb68488c82e8185d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.10

Security for ignutils 0.0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.10 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page