Skip to main content

Reusable components

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

ignutils-0.0.10-py3-none-any.whl (85.9 kB view details)

Uploaded Python 3

File details

Details for the file ignutils-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: ignutils-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 85.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for ignutils-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 db8afc49e795e1743de318b90507d03d1d3c82a811ec68f94e56c9b589fd6e97
MD5 df0e2b4c11fe4c4855581b529592851d
BLAKE2b-256 b4a290d243f1614bc3c397d44a594dc231f52ccf2befc3bdb68488c82e8185d6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page