Package: ctu
coco-transform-utilA python package to perform same transformation to coco-annotation as performed on the image.InstallationWay 1$gitclonehttps://github.com/Cargill-AI/coco-transform-util.git
$cdcoco-transform-util
$python3setup.pyinstallWay 2$pip3installgit+https://github.com/Cargill-AI/coco-transform-util.git<<<Username:<user_idoremail><<<Password:<personalaccesstokenorSSHkey>Personal Access token looks like this83b318cg875a5g302e5fdaag74afc8ceb6a91a2e.Reference:How to generate Personal Access tokenCheck installationimportctuprint(ctu.__version__)Benefits and Use CasesFaster Model Training: Decrease the size of images and accordingly its annotation will be changed using this.Flexibility: Rescaling of images and annotations to meet the need of Model/Framework.Cost Saving: Lesser Computation requirement as images can be downscaled.Interpretability: Annotation Visualization is also a part of this package.Data Augmentation: <more practical in future>Ability to handle other cases: Added Functionality such as cropping or padding of the annotation can help in multiple other cases such as:cropping out each object image & annotation from an original imagecropping unnecessary area to zoom in on some particular area.converting images to 1:1 aspect ratio by using padding and/or cropping.How to use it?CoreThere are four core modules inside that helps in performing operations on COCO Annotation. These can imported as shown below:fromctuimportWholeCoco2SingleImgCoco,Coco2CocoRel,CocoRel2CocoSpecificSize,AggreagateCocoIt's recommended that you have look atsamples/example_core_modules.pyto understand and explore how to use these.WrapperMaking use of wrappers can also come in handly to perform multiple operations in a much simpler and interpretable manner using the functions provided below:fromctuimport(sample_modif_step_di,get_modif_imag,get_modif_coco_annotation,accept_and_process_modif_di,ImgTransform,Visualize)It's recommended that you have look atsamples/example_highlevel_function.pyto understand and explore how to use these.Some sample data has also been provided with this package atexample_data/*to explore these functionalities.Demo / SampleA sample HTML created from Jupyter-Notebook, contating some sample results has been added to the pathsamples/Demo-SampleOutput.html.Version Historyv0.1: Core Modules:WholeCoco2SingleImgCoco, Coco2CocoRel, CocoRel2CocoSpecificSize. External Dependency on AMLEET package.v0.2: Removed the dependency on AMLEET package. Develop Core Module:AggreagateCoco. Addition of field "area" under "annotations" in coco.v0.3: Completed: Remove the out of frame coordinates in annotation. Update & add fields in "annotation" > "images". Ability to create transparent and general maskcreate_mask.In Development:Ability to export transformed image, mask and annotation per image wise and as a whole too.FutureUpdate the image fields in "images" key. (done)Crop out the annotation which are out-of-frame based on recent image shape. (done)Annotation Visualization + Mask creation can become a core feature to this library. (done)Rotate 90 degree left/right.Flip horizontally or vertically.COCO to other annotation format can also be a feature to this package.Push to pypi$python3setup.pysdist
$twineuploaddist/*