Metadata-Version: 2.1
Name: ignutils
Version: 0.0.10
Summary: Reusable components
Author-email: "Ignitarium Technology Solutions Pvt. Ltd." <jerin.antony@ignitarium.com>
Project-URL: Homepage, https://gitlab.ignitarium.in/ign-ai/internal/ignutils
Project-URL: Issues, https://gitlab.ignitarium.in/ign-ai/internal/ignutils/-/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: bagpy
Requires-Dist: cryptography
Requires-Dist: cv-bridge
Requires-Dist: docker
Requires-Dist: easyprocess
Requires-Dist: fabulous
Requires-Dist: GitPython
Requires-Dist: GPUtil
Requires-Dist: imgaug
Requires-Dist: imutils
Requires-Dist: loguru
Requires-Dist: lsb-release-ex
Requires-Dist: matplotlib
Requires-Dist: ntplib
Requires-Dist: numpy
Requires-Dist: opencv-python
Requires-Dist: open3d
Requires-Dist: pandas
Requires-Dist: Pillow
Requires-Dist: pyautogui
Requires-Dist: pynput
Requires-Dist: pynvml
Requires-Dist: pyrealsense2
Requires-Dist: pyvirtualdisplay
Requires-Dist: scikit-image
Requires-Dist: selenium
Requires-Dist: shapely
Requires-Dist: sympy
Requires-Dist: termcolor
Requires-Dist: bs4
Requires-Dist: scipy
Requires-Dist: segment-anything
Requires-Dist: transformers

# ignutils
<div align="center">
  <img src="ignitarium-logo.png">
</div>

[![PyPI version](https://badge.fury.io/py/ignutils.svg)](https://badge.fury.io/py/ignutils)

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](ignutils)  :heart_eyes_cat: Computer Vision Package

- [x] [Json Utils](ignutils/ignutils/json_utils.py): Utils for reading, writing, comparing json files..

- [x] [Transform Utils](ignutils/ignutils/transform_utils.py) : transform_crop, transform paste, transform_img, transform_contour, expand_box, etc.

- [x] [Geom Utils](ignutils/ignutils/geom_utils.py) : Geometric operations using points, lines eg: euclidean, line_intersection, get_nearest_pt on a curve.

- [x] [Contour Utils](ignutils/ignutils/contour_utils.py)  : Resizig, rotation, shifting, union, intersection etc of contours.

- [x] [Show Utils](ignutils/ignutils/show_utils.py) : Show image and json, handles user keypress, wrapper for imshow ans matplot.

- [x] [MultiProcess](ignutils/ignutils/multi_process_utils.py) : Base class for multiprocess, inherit and overide do_something function.

- [x] [Gpu Utils](ignutils/ignutils/gpu_utils.py) : Get gpu memory free, select device for tensorflow and pytorch, etc

- [x] [Mouse Utils](ignutils/ignutils/mouse_utils.py) : Mouse based ROI selection, contour drawing etc.

- [x] [Keyboard Utils](ignutils/ignutils/keyboard_utils.py) : Keyboard based utils for selected key recognition.

- [x] [Fisheye Utils](ignutils/ignutils/fisheye_utils.py)  : Handling fisheye distortion and undistortion, cropping from distorted image.

- [x] [Draw Utils](ignutils/ignutils/draw_utils.py)     : Drawing text and polygon on image with params autoselcted.

- [x] [Clone Utils](ignutils/ignutils/clone_utils.py) : git clone, commit and push using api.

- [x] [Yaml Utils](ignutils/ignutils/yaml_utils.py) : Read, Write, Custom Format Yaml files.

- [x] [Registration](ignutils/ignutils/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
```

- [x] [Video Utils](ignutils/ignutils/video_utils/)    : Getting frames from video , with preprocessing and threading options.

- [x] [Cam Utils](ignutils/ignutils/cam_utils): Getting frames from camera, setting properties of camera.

- [x] [Config Utils](ignutils/ignutils/config_utils.py): Class to handle config creation for any module with config_path as input.​


- [x] [File Utils](ignutils/ignutils/file_utils.py) : Funcs for handling files.\
Eg: get files by extension, checksum of file etc.

- [x] [TypeHint Utils](ignutils/ignutils/typehint_utils.py) : Typehint for common data structures like contour, image, etc for making functions more readable   

- [x] [Docker Utils](ignutils/ignutils/docker_utils.py): To handle basic docker functionalitys like bringdown_container, bringup_container etc,.

- [x] [Labelme Utils](ignutils/ignutils/labelme_utils.py): 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`

- [x] [SSH Utils](ignutils/ignutils/ssh_utils.py): Utils for mounting and unmounting sshfs filesystems

- [x] [Timer Utils](ignutils/ignutils/timer_utils.py): 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.
