{"id":16698850,"url":"https://github.com/mrl-amrl/preimutils","last_synced_at":"2025-04-10T03:42:21.649Z","repository":{"id":40405755,"uuid":"241170455","full_name":"mrl-amrl/preimutils","owner":"mrl-amrl","description":"All you need to preprocess and prepare your annotated dataset","archived":false,"fork":false,"pushed_at":"2022-06-26T08:07:36.000Z","size":1945,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T05:01:43.070Z","etag":null,"topics":["computer-vision","dataset-labels","image-augmentation","label-checker","neural-network","pascal-voc-format"],"latest_commit_sha":null,"homepage":"https://a-sharifi.github.io/preimutils-doc/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrl-amrl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-17T17:43:31.000Z","updated_at":"2024-12-20T10:36:30.000Z","dependencies_parsed_at":"2022-09-16T06:01:21.116Z","dependency_job_id":null,"html_url":"https://github.com/mrl-amrl/preimutils","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrl-amrl%2Fpreimutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrl-amrl%2Fpreimutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrl-amrl%2Fpreimutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrl-amrl%2Fpreimutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrl-amrl","download_url":"https://codeload.github.com/mrl-amrl/preimutils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247730065,"owners_count":20986404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","dataset-labels","image-augmentation","label-checker","neural-network","pascal-voc-format"],"created_at":"2024-10-12T18:04:17.701Z","updated_at":"2025-04-10T03:42:21.626Z","avatar_url":"https://github.com/mrl-amrl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PreImutils\n![PreImutils](docs/imgs/preimutils.png)\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n[![Made in MRL](https://img.shields.io/badge/Made%20in-Mechatronic%20Research%20Labratories-red.svg)](https://www.qiau.ac.ir/)\n\nPreImutils is a python library built to empower developers, reseachers and students to prepare and preprocessing image datasets for applications and systems with Deep Learning and Computer Vision capabilities using simple and few lines of code. This documentation is provided to provide detailed insight into all the classes and functions available in PreImutils, coupled with a number of code examples.\n\nThe Official GitHub Repository of PreImutils is https://github.com/mrl-amrl/preimutils\n\nFor read the full doc please visit   \nhttps://a-sharifi.github.io/preimutils-doc/\n\n## Easy to use:\n\n## Why we need PreImutils?\nEverything that you need to preprocess your image dataset is here.\nOne of the most important item for machine learning or CNN or other neural networks is preparing your dataset.\n\n    - It's easy to use.\n    - You can use both in terminal and code.\n    - It has separate classes for object-detection and segmentation datasets.\n\n## For Object detection\n### Use in Code\n\n```python\nfrom preimutils.object_detection import AMRLImageAug\n\nimg_aug = AMRLImageAug(json_path, xmls_dir, images_dir)\nimg_aug.auto_augmentation(quantity, resized = True, width = 300, height = 300)\n```\n### Use in Terminal\n\n```bash\nJSON_PATH=~/YOUR_JSON_PATH/label.json\nXMLS_DIR=~/YOUR_ANNOTATION_DIR/\nIMAGES_DIR=~/YOUR_IMAGES_DIR/\nFUNCTION=auto_augmentation\nQUANTITY=1000 # the amount of each object to create\n\npreimutils --function $FUNCTION --label_json_path $JSON_PATH --xmls_dir $XMLS_DIR --images_dir $IMAGES_DIR --quantity $QUANTITY\n```\n## For segmentation task\n\n```python\nfrom preimutils.segmentations.voc import Dataset\nfrom preimutils.segmentations.voc import SegmentationAug\n\n\ndataset = Dataset('./VOC2012', images_extention='jpg')\n\n# First checking to have valid dataset(All dirs exist all mask's image exist or no)\ndataset.check_valid_dataset()\nseg = SegmentationAug(dataset.label_map_path,dataset.masks_dir,dataset.images_dir, images_extention='jpg')\n\n# At the end, there must be 2000 of each object\nseg.auto_augmentation(2000)\n# Seprate dataset into validation 10% test 10% and train 80% and save it to train.txt,trainval.txt ,val.txt,test.txt\ndataset.seprate_dataset(shuffle=True,valid_persent=0.10,test_persent=0.10,save=True)\n```\n## Some points\n\n\n    1.  The amount of your dataset is really important. Not very few that lose the accuracy not great number of that lose your time and cause to overfitting, more than 4000 image per object is enough that mostly. depend on how much your feature is hard.\n    2.  The amount of each object image is important if objects sample count not equal your neural network forget the lower object count for instance if you have 3 object each one should have 4000 sample.\n\n\n    3. Don't forget to shuffle your dataset if you don't do that you never ever don't get good accuracy on all of your objects.\n    4. If you want to detect your object from all angles don't forget to put sample from other angle\n   \n### attention\n  - **No**:\n\n\n      | object   | Sample Count |\n      | -------- | :----------: |\n      | object 1 |     2000     |\n      | object 2 |     1000     |\n      | object 3 |     4000     |\n  \n\n  - **Yes**:\n\n\n      | object   | Sample Count |\n      | -------- | :----------: |\n      | object 1 |     3900     |\n      | object 2 |     4100     |\n      | object 3 |     4000     |\n  \n\n**PreImutils** help you to do these points in few line of code. \n\n## How should I use Preimutils?\n\nWe prepare a full documentation in https://a-sharifi.github.io/preimutils-doc/ .\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrl-amrl%2Fpreimutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrl-amrl%2Fpreimutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrl-amrl%2Fpreimutils/lists"}